how to start LXDE session automatically after tightvncserver starts to make me able see desktop when connecting to the host via vncclient?

51,965

Solution 1

In my ~/.vnc/xstartup file, I replaced /etc/X11/Xsession with /usr/bin/startlubuntu.

Solution 2

The mentioned solutions dates back to 2012 and 2013. Same solution doesn't apply to lubuntu 13 or 14 as startlubuntu was removed.

The solution is mentiond in a launchpad Bug #1241958, which is to use lxsession -e LXDE -s Lubuntu instead of /etc/X11/Xsession.

Share:
51,965

Related videos on Youtube

Oleksandr Dudchenko
Author by

Oleksandr Dudchenko

Updated on September 18, 2022

Comments

  • Oleksandr Dudchenko
    Oleksandr Dudchenko over 1 year

    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
    1. 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.

    2. 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
    3. Add ssh daemon into autostart sequence during boot.

      $ sudo update-rc.d -f ssh defaults
    4. Power off the host PC

      $ sudo halt
    5. 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
      
      
    6. 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?

  • Oleksandr Dudchenko
    Oleksandr Dudchenko over 11 years
    But now the fallowin issue has arisen: I started tigntvnc server on display :2 and when I try to run Chromium browser via vnc client it starts on the display :0. How to cure this?
  • nilsonneto
    nilsonneto over 11 years
    this should be a new question.
  • Len
    Len over 9 years
    startlubuntu instead of starlubuntu ('t' missing)
  • fakedad
    fakedad about 7 years
    Yes! This needs more up votes!
  • Phil UK
    Phil UK about 7 years
    Welcome to the site and thank you for your input. Please edit your answer to give a bit more details, such as the expected outcome, details of it working before or anything else like that.