Skip to content

Instantly share code, notes, and snippets.

@sbatururimi
Last active June 11, 2019 06:35
Show Gist options
  • Save sbatururimi/e50b53abdba06e28e002bcd0d97b28ce to your computer and use it in GitHub Desktop.
Save sbatururimi/e50b53abdba06e28e002bcd0d97b28ce to your computer and use it in GitHub Desktop.
Access a remote ubuntu desktop
1. Install tightvnc
```bash
sudo apt-get install tightvncserver
```
2. Setup the vnc to start the default desktop
```
vi ~/.vnc/xstartup
```
3. Insert and save:
```
#!/bin/sh
#unset SESSION_MANAGER
#exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
```
3. start the vnc server
```
vncserver :1
```
4. share your current X desktop:
```
sudo apt-get install x11vnc
x11vnc -forever -display :1
```
5. Launch the vnc client using [noVNC](https://github.com/novnc/noVNC):
```
./utils/launch.sh --vnc localhost:5900
```
PS: you should check the output of 4.
6. Access your remote desktop:
```
<machine ip>:6080/vnc.html
```
Additionally, setup a password: vncpasswd
Sources:
https://www.linode.com/docs/applications/remote-desktop/install-vnc-on-ubuntu-16-04/
https://github.com/novnc/noVNC/wiki/Advanced-usage
https://help.ubuntu.com/community/VNC/Servers#tightvncserver
https://linux.die.net/man/1/vncpasswd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment