how to start LXDE session automatically after tightvncserver starts to make me able see desktop when connecting to the host via vncclient?
- by Oleksandr Dudchenko
I have system which is equipped with Intel Celeron processor 1.1 GHz s370 with 384 Mb of RAM on Intel d815egew motherboard which supports wake-on-lan function. I want to use such a PC for Internet sharing to the local network. Also this PC is a DHCP+DNS server as well as router/gateway. Based on above I decided to install Lubuntu as it is lightweight system. I installed Lubuntu 10.04.4 LTS from alternate ISO. System has no auto login. System boots and has acceptable performance.
Host PC has onboard 4 network adapters:
eth0 – ethernet controller which is used for Local Network connections. Has static address 10.0.0.1
eth1 – ethernet controller which is not used and not configured so far, I plan to connect printer here later on.
eth2 - ethernet controller which is used to connect to Internet, which we plan to share for the local network
wlan0 – wireless controller, it is used in role of access poit for local Network and has address 10.0.0.2
We want to control our gateway remotely. So, we need to be able to power it on remotely. To allow this I’ve done the following things:
$ cd /etc/init.d/
made a new file with command
$ sudo vim wakeonlanconfig
Wrote the following lines to the newly created file, saved and closed it
#!/bin/bash
ethtool -s eth0 wol g
ethtool -s eth2 wol g
exit
Made the abovementioned file executable
$ sudo chmod a+x wakeonlanconfig
Then included it into autostart sequence during boot.
$ sudo update-rc.d -f wakeonlanconfig defaults
after system reboot we will be able to poweron system remotely.
Than we need to have a possibility to connect remotely to the host via SSH and VNC. So, I installed following packets with the following commands:
$ sudo apt-get update
$ sudo apt-get install openssh-server tightvncserver
Add ssh daemon into autostart sequence during boot.
$ sudo update-rc.d -f ssh defaults
Power off the host PC
$ sudo halt
Then I went to remote place, send magic paket and powered the Host up. System started... And I connected to the host via Putty from remote system under Windows. Than logged in and run the command to start vnc server.
$ tightvncserver -geometry 800x600 -depth 16 :2
VNC server successfully started and I got message like follows.
New 'X' desktop is gateway:2
Starting applications specified in /home/dolv/.vnc/xstartup
Log file is /home/dolv/.vnc/gateway:2.log
Using UltraVNC Viewer programm under windows I connected to the host's vnc server, enterd the password and.... sow only mouse cursor in form of cross on a grey background of 800x600 dots, no desktop.
Here is my .vnc/xstartup file
#!/bin/sh
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
The Question: What I have to change and where to make LXDE session start automatically after tightvncserver starts?