0

I need to run Firefox (or some other web browser, but I prefer Firefox) on a non-local (i.e. not on my PC, not reachable via LAN) Unix virtual machine and then control it using keyboard and mouse, because some websites only work with Javascript and don't allow downloads unless I'm logged in. ssh -X doesn't cut it, because it is a pain to use unless you are connected to the Internet with 10 Gbit/s. And I don't really feel like installing one of the fat "lightweight" desktop environments like Gnome or Xfce. And of course Firefox is not supposed to run as root.

1 Answer 1

1

I ended up installing the following on my Ubuntu 20.04: apt-get install firefox xterm icewm xvfb x11vnc (instead of icewm, you can use fluxbox, i3 or the window manager of your choice, but then you might have to start xterm before you can run Firefox). I then ran

#1600x900x32 does not work Xvfb :42 -screen 0 1600x900x24 & #only necessary if it hasn't been set correctly export DISPLAY=:42 icewm & x11vnc -display :42 -bg -nopw -listen localhost -xkb 

On my PC at home I then ran

ssh -NTL 5900:localhost:5900 [email protected] & #your favorite VNC client, e.g. tigervnc-viewer vncviewer localhost:5900 

After that I could start Firefox within icewm the mouse-clicky way. Starting Firefox directly (without icewm) did not work, because Firefox starts with a tiny window and no window decorations and thus can't be resized to a usable size. You can also do this without Xvfb, using a regular X server, but that was even more of a pain. You need gtf and xrandr (from x11-xserver-utils) to change screen resolution and potentially need to run xhost +SI:localuser:user to allow user to run X applications (because contrary to what I read "should just work", non-root users in Ubuntu can't run X applications by default if I installed it as a headless server without desktop environment - I don't know why).

One disadvantage of Xvfb is that you are likely not able to control Firefox/Icewm from your hoster's server control panel (unless that panel allows you to use a VNC connection with arbitrary parameters).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.