Install a Desktop and VNC Server on your AWS ubuntu server

after launch a new AWS ubuntu server virtual machine, there is no ubuntu-desktop support. To install a vnc server and see the desktop, need to install ubuntu-desktop first.

sudo apt-get install ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

This will install the full Ubuntu desktop environment, including office and web browsing tools. To install the desktop without these packages, run:

sudo apt-get install --no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

Install the VNC server:

sudo apt-get install vnc4server

after you start vncserver and connect to vnc, you will see a grey empty desktop. ~/.vnc/xstartup need to be modified.

vncserver -kill :1

and then

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# 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-session &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

自由撰稿人,时评人,平等公义追求者

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store