• Around The HomeToggle Menu

    • Entertainment
    • Productivity
    • Smart Home
  • FamilyToggle Menu

    • Parenting
    • Toys
    • Pets
    • Travel
  • Product ReviewsToggle Menu

    • Phones
    • Tablets
    • Laptops
    • Desktops
    • Wearables
    • Audio
    • Cameras
    • Headphones
    • Printers
    • Smart Home
    • TVs
    • Gaming and Video
  • One Cool ThingToggle Menu

    • Frugal Tech
    • Kickstarters
    • Videos
Techwalla
  1. Home
  2. Around The Home
  3. Productivity
  4. How to Install a VNC Server in Ubuntu

How to Install a VNC Server in Ubuntu

March 31, 2015
By: Kristen Waters
  • Share
  • Share on Facebook

Virtual Network Computing (VNC) is a way to share the desktop of one computer (server) with a remote computer (client). The client's keyboard and mouse input are transmitted over a network and control the operation of the server. The server's graphics are transmitted back over the network. Except for some latency issues, it will appear as if you are working directly on the machine you are sitting at. However, all programs and commands are performed on the server side.

...

Step

Open a Terminal window. The Terminal window can be found under "Start" > "Utilities."

Step

Download vnc4server and xinetd: sudo apt-get install vnc4server xinetd

Step

Start the vnc4server: vnc4server

You will be prompted for a password. This password will be used to log into the VNC session.

After providing a password, you will get output that looks like: New 'laptop:3 (laptop)' desktop is laptop:3

Take notice of the number after the colon (:), in this case it is "3."

Starting the vnc4server will cause a .vnc directory to be placed in your home directory.

Step

Stop the vnc4server vnc4server -kill :3

Replace the number "3" with the number from Step 3.

Step

Open the .vnc/xstartup file for editing: gedit ~/.vnc/xstartup

The file will look like: #!/bin/sh # Uncomment the following two lines for normal desktop: #unset SESSION_MANAGER #exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & twm &

Step

Change the .vnc/xstartup file and save it.

Uncomment the lines that start with unset and exec. Comment out the lines that start with xsetroot, vncconfig, xterm and twm.

The final file should look like: #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources #xsetroot -solid grey #vncconfig -iconic & #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & #twm &

Step

Change the permissions on the /etc/X11/xinit/xinitrc file to make it executable: sudo chmod 755 /etc/X11/xinit/xinitrc

Step

Start the vnc4server: vnc4server

Again, remember the number after the colon (:).

Step

Log into your remote desktop to check the configuration: vncviewer localhost:3

Provide the password that you chose in Step 3.

Show Comments

Related Articles

How to Use VNC Viewer in Ubuntu

How to Use VNC Viewer in Ubuntu

Around The Home
Productivity
By: Kristen Waters
How to Get Roblox Running on Ubuntu

How to Get Roblox Running on Ubuntu

Around The Home
Productivity
By: DaveW
How to Install a DMG File on Ubuntu

How to Install a DMG File on Ubuntu

Around The Home
Productivity
By: Seth Amery
How to Fix Bad Sectors in Ubuntu

How to Fix Bad Sectors in Ubuntu

Around The Home
Productivity
By: Joe Teagno
How to Update the Drivers in Ubuntu

How to Update the Drivers in Ubuntu

Around The Home
Productivity
By: David Wayne
How to Uninstall Apache Server

How to Uninstall Apache Server

Around The Home
Productivity
By: Tammy Columbo
  • HOW WE SCORE
  • ABOUT US
  • CONTACT US
  • TERMS
  • PRIVACY POLICY
  • COPYRIGHT POLICY
  • Advertise

An error occurred. Try again later.

Thanks for signing up!
© 2018 Leaf Group Ltd. / Leaf Group Lifestyle

Get great tech advice delivered to your inbox.

Keep your family productive, connected, entertained, and safe.

Please enter a valid email.