Skip to content

Instantly share code, notes, and snippets.

@CrabAss
Last active March 9, 2023 12:39
Show Gist options
  • Save CrabAss/b1b1e867a5ecd897cefa5c45a1ead1f4 to your computer and use it in GitHub Desktop.
Save CrabAss/b1b1e867a5ecd897cefa5c45a1ead1f4 to your computer and use it in GitHub Desktop.
How to remotely run Firefox on Ubuntu Server 18.04

How to remotely run Firefox on Ubuntu Server 18.04

My environment

  • Ubuntu Server 18.04 on my local Hyper-V (on Windows 10 Pro 19H2)
  • SSH client: Xshell 6

Procedure

Configure X11 Forwarding

  1. Download and install VcXsrv. Start "XLaunch" in the Start Menu. A configure wizard will appear. Just keep clicking "Next" to the end.

  2. It's assumed that you've already had the SSH profile in your installed Xshell. You need to enable the X11 forwarding in that profile. From the toolbar, click Properties. From Category, Select SSH, and then Tunneling. Select Forward X11 connections to, then click OK button.

  3. You also need to enable X11 forwarding in Ubuntu Server. Open the /etc/ssh/sshd_config file. Set the X11Forwarding option as following:

    X11Forwarding   yes
    
  4. Restart the SSH server: service ssh restart

  5. Reconnect to the Ubuntu Server if needed, and run the following command: sudo apt install -y xauth x11-apps

  6. You may run xcalc to see if X11 forwarding is working properly.

Install Firefox and its dependencies

  1. Run the following command:

    sudo apt install -y xorg openbox mesa-utils libgl1-mesa-glx firefox
    
  2. If you want to install Chinese fonts, run:

    sudo apt install -y fonts-droid-fallback fonts-wqy-zenhei fonts-wqy-microhei fonts-arphic-ukai fonts-arphic-uming
    
  3. You can run firefox now.

Important reminder

Do NOT install Firefox through snap! The snap version is actually broken on Ubuntu Server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment