Headless Fluxbox / TightVNC

This guide is for Ubuntu 18.04. I needed a super lightweight GUI to run some applications without installing a full blown desktop environment and this seemed like a pretty good option. I would not recommend using this over the internet without an SSH tunnel.

  1. Install fluxbox and tightvnc.
    • apt install fluxbox tightvncserver xterm
  2. Run the VNC server manually on the user so you can set a password.
    • tightvncserver :0
    • tightvncserver -kill :0
  3. Edit /etc/systemd/system/tightvnc.service (change the user/group if needed)
[Unit]
Description=TightVNC

[Service]
User=ubuntu
Group=ubuntu
Type=forking
ExecStart=/usr/bin/tightvncserver -depth 24 -geometry 1440x900 :0
ExecStop=/usr/bin/tightvncserver -kill :0
Restart=on-failure

[Install]
WantedBy=multi-user.target
  1. Start.
    • systemctl daemon-reload
    • systemctl start tightvnc.service
  2. If you want to run GUI applications from outside VNC, export the display.
    • export DISPLAY=:0
  3. To add a custom menu edit ~/.fluxbox/menu
    • Add below [begin]
    • [exec] (xterm) {xterm}
Comments