Remote XFCE Session

This tutorial explains how to create a desktop connection between GNU-Linux computers by using vnc4server with the XFCE desktop environment.

  1. Install vnc4server in the server

    apt-get install vnc4server

  2. Install xvnc4viewer in the client

    apt-get install xvnc4viewer
  3. Create the vnc4server configuration files

    In the server use the command (as a normal user): vnc4server

    You will be then requested by a password, and then it will create the configuration files.

  4. Adapt the vnc4server configuration files for XFCE

    Replace the content of the file ~/.vnc/xstartup with the following:

    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 80×24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    x-window-manager &
  5. Start a vnc4server process in the server


    The command will generate an output like:

    rsm@server-computer:~$ vnc4server
    New 'server-computer:3 (rsm)' desktop is server-computer:3
    Starting applications specified in /home/rsm/.vnc/xstartup
    Log file is /home/rsm/.vnc/server-computer:3.log

    It is important to remember the screen number. For this example it is 3.

  6. Find the server's ip

    In the server execute the command ifconfig as root:

    Root Terminal
    root@server-computer:/home/rsm# ifconfig
    eth0      Link encap:Ethernet  HWaddr 5c:26:0a:4b:6c:d9  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    lo        Link encap:Local Loopback  
              inet addr:  Mask:
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:5790 errors:0 dropped:0 overruns:0 frame:0
              TX packets:5790 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:1864588 (1.7 MiB)  TX bytes:1864588 (1.7 MiB)
    wlan0     Link encap:Ethernet  HWaddr b4:82:fe:56:a0:e2  
              inet addr:  Bcast:  Mask:
              inet6 addr: fe80::b682:feff:fe56:a0e2/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:190415 errors:0 dropped:0 overruns:0 frame:0
              TX packets:224162 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:44354470 (42.2 MiB)  TX bytes:61141837 (58.3 MiB)				 

    Then, depending of the Internet connection (Ethernet, Lan..) read the inet addr 192.168.XXXXXXX... Ex:

  7. Request a connection from the client

    In the client execute the command xvnc4viewer <ip>:<display>. Ex: xvnc4viewer


  • Published on August 7, 2015.
  • Last modified on February 6, 2016.

Send a feedback