Thursday, March 28, 2013

[Level 2] Allow remote display in Ubuntu 12.04/10.04

If you want to allow remote display in Ubuntu 12.04, you have do the following steps:
1. remove "-nolisten tcp" from /etc/X11/xinit/xserverrc
#[before]
$ cat /etc/X11/xinit/xserverrc
exec /usr/bin/X -nolisten tcp "$@"

#[after]
$ cat /etc/X11/xinit/xserverrc
exec /usr/bin/X "$@"

2. add "xserver-allow-tcp=true" into /etc/lightdm/lightdm.conf
#[before]
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter

#[after]
[SeatDefaults]
user-session=ubuntu
greeter-session=unity-greeter
xserver-allow-tcp=true

3. restart X

4. allow remote x connection
local> xhost +

5. ssh remote server and set DISPLAY
local> ssh remote_server
remote> export DISPLAY=local_ip:0.0
remote> xclock
in 10.04, you have to change above step 2 as the following:
2-10.04: add "DisallowTCP=false" in "security" section.
#[before]
$ cat /etc/gdm/custom.conf 
[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=true
TimedLogin=stanley
AutomaticLogin=stanley
TimedLoginDelay=30
DefaultSession=gnome

#[after]
$ cat /etc/gdm/custom.conf 
[daemon]
TimedLoginEnable=false
AutomaticLoginEnable=true
TimedLogin=stanley
AutomaticLogin=stanley
TimedLoginDelay=30
DefaultSession=gnome

[security]
DisallowTCP=false


Wish this helps.

regards,
Stanley Huang