This can be done. Following are the steps to setup the GUI
Create new user with password login. (But a new user is actually not needed)
sudo useradd -m awsgui
sudo passwd awsgui
sudo usermod -aG admin awsgui
sudo vim /etc/ssh/sshd_config # edit line "PasswordAuthentication" to yes
sudo /etc/init.d/ssh restart
Setting up ui based ubuntu machine on AWS. In security group open port 5901. Then ssh to the server instance. Run following commands to install ui and vnc server:
sudo apt-get update
sudo apt-get install ubuntu-desktop
sudo apt-get install vnc4server
Then run following commands and enter the login password for vnc connection:
vncserver
# actually, now the vnc client should be able to connect and see a gnome terminal
vncserver -kill :1
vim awsgui/.vnc/xstartup
Then hit the Insert key, scroll around the text file with the keyboard arrows, and delete the pound (#) sign from the beginning of the two lines under the line that says "Uncomment the following two lines for normal desktop." And on the second line add "sh" so the line reads
exec sh /etc/X11/xinit/xinitrc.
(this may not be correct) Then start vnc server again. vncserver
In the vnc client, give public DNS plus ":1" (e.g. www.example.com:1). Enter the vnc login password. Make sure to use a normal connection. Don't use the key files.
Additional guide available here: http://www.serverwatch.com/server-tutorials/setting-up-vnc-on-ubuntu-in-the-amazon-ec2-Page-3.html
Mac VNC client can be downloaded by yourself
sudo apt-get install dconf-tools
not sure if there's any effect
Change ~/.vnc/xstartup
. Not sure. Mess around and try. See the other file.
Don't know what's these
export XKL_XMODMAP_DISABLE=1
unset DBUS_SESSION_BUS_ADDRESS
Install missing packages.
If see "permission denied" at /run/user/1000
, try sudo chown -R <user name> 1000/
. This solves the problem that windows can't be dragged.
When running sudo software-center
I got errors about X11 and DBUS. So in xstartup add exec sh /etc/X11/xinit/xinitrc
. Then permision denied. Change ownership. sudo chown ubuntu /etc/X11/xinit/xinitrc
, chmod +x
, but still gray screen after exec xinitrc