Setting up VNC Server on Ubuntu

Setting up VNC Server

To set up VNC server on Ubuntu, follow these steps:

1. Install a VNC server software. A popular option is TightVNC:

    sudo apt-get update
    sudo apt-get install tightvncserver

2. Start the VNC server and set a password: 

    vncserver

3. Stop the VNC server:

    vncserver -kill :1

4. Use your favourite editor to edit the configuration file ~/.vnc/xstartup:
    
If you're a fan of vim:

    vim ~/.vnc/xstartup

If you're a fan of nano:

    nano ~/.vnc/xstartup

5. Add the following lines to the file:

    #!/bin/sh
    xrdb $HOME/.Xresources
    startxfce4 &

6. Start the VNC server with the following command:

    vncserver
    
7. Connect to the VNC server using a VNC client from your local location. 

The connection address will be in the format of: <host>:<display_number>

As an example, if your IP address is 123.123.123.111 then your connection will be: 127.0.0.1:5901 if your <display number> is 1

Note: You may need to open the firewall for the VNC port, which is 5901 by default, though from a security perspective, it is better to tunnel your VNC server through SSH rather than opening port 5901 to the world.

Securing VNC so it runs through SSH

On the client machine, use the following command to create the SSH tunnel:

    ssh -L 5901:localhost:5901 <user>@<server_IP>

Connect to the VNC server using a VNC client. The connection address will be localhost:1.

Note: The SSH connection must be kept open while using the VNC server. The VNC server will automatically shut down if the SSH connection is closed.
Name

false
ltr
static_page
Tech Lab: Setting up VNC Server on Ubuntu
Setting up VNC Server on Ubuntu
Tech Lab
https://techlab.connektiv8.com/p/setting-up-vnc-server-on-ubuntu.html
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/
https://techlab.connektiv8.com/p/setting-up-vnc-server-on-ubuntu.html
true
5093225316588518036
UTF-8
Not found any posts Not found any related posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU Tag ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Contents See also related Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy THIS PREMIUM CONTENT IS LOCKED STEP 1: Share to a social network STEP 2: Click the link on your social network