Sei sulla pagina 1di 5

10/1/2010

How to install VNC server on an Ubuntu

How to install VNC server on an Ubuntu PC and remote connect to it from a Windows PC the seeker quill s On the Ubuntu 9.1 PC 0
The Ubuntu 9.1 PC shall hereafter be referred to asthe 0 SERVER. 1 First of all, permit remote desktop on the SERVER: . From the menubar, select System | Preferences| Remote Desktop 1 Under Sharing: . 1 Check Allow othe use to vie your de . r rs w sktop 2. Check Allow othe use to control your de r rs sktop 2. Under Security: 1 Select Re . quiretheuse toe r thispassword r nte and enter a password. 3. Under Notification area: 1 Select Only display an icon whe the issome . re re body conne d. cte 4. Make a note of the network addressand name of the SERVER asdisplayed in the Remote Desktop Preferences. 2. Now ensure the required applicationsare installed: From the menubar, select System | Administration | Synaptic Package Manager 1 In the quick search box, type vnc . 2. For each of the following four packages, right-click on them and select Mark for Installation 1 vnc4server . 2. vnc4-common 3. vinagre 4. vino 3. In the quick search box, type xine and install asdescribed above. td 4. Finally, select Apply on the menubar to complete the installation. 3. Now letscomplete the VNC server install and configuration. Open up a command terminal: 1 Run vncpasswd and enter the password that will be required by the client when . attempting to connect to the SERVER
wordpress.com//vnc-server-ubuntu- 1/5

10/1/2010

How to install VNC server on an Ubuntu

vncpasswd 2. Run the vncserver on display number 1 in order to generate the configuration filesthat we will subsequently customize. vncserver :1 3. If you were to connect via remote desktop from a client at thispoint, the resolution would be wrong and the screen would be plain grey. Do not worry, we will fix that now. First, kill the vncserver processby issuing the command: vncserver -kill :1 4. Edit the xstartup file in the folder .vnc (make a backup of the file first) gedit ~/.vnc/xstartup 5. Ensure the file hasthe contentsasfollows: #!/bin/sh unset SESSION_MANAGER sh /etc/X11/xinit/xinitrc 4. Finally, to run the vnc server on the SERVER (on display 1 issue the command: ), vncserver :1 -depth 16 -geometry 1028x1024

On the Windows PC
The WindowsPC shall hereafter be referred to asthe CLIENT. 1 Download and install the VNC viewer of your cloice. I am using the free open source . UltraVNC[1] viewer. Note: UltraVNC ishighly customizable. 2. Run vncviewer.exe 1 Enter in the network addressof the SERVER pc (asrecorded in step 1 . ) immediately followed by a colon : and the display number. The following isan example of the format: 111.222.333.444:1 2. Under Quick Options, select Auto. 3. When prompted, enter the password specified in step 3.1 3. Well Done! You are now connected over remote desktop to the Ubuntu PC from your WindowsPC.

wordpress.com//vnc-server-ubuntu-

2/5

10/1/2010

How to install VNC server on an Ubuntu

How to configure the VNC server to run at bootup on the Ubuntu PC.
In practice, you will not want to logon to the SERVER just to initiate the VNC server. Moreover, you may not even have a monitor for your Ubuntu Server, because you may be using the monitor asa dual screen for your primary desktop, asin my case. These instructionshave been referenced from here[2]. To that end I will now explain how to ensure the VNC server isinitialised at bootup time (simply by switching on the SERVER). All of the following stepswill required you to be logged in asroot. 1 Open up a terminal and login asroot . sudo -i 2. Run all the commandsoutlined in step 3(for the Ubuntu PC) asroot. 3. Create a new file in /e tc/init.d called vncse r and ensure it hasthe following contents: rve Note: Change the username (and optionally the other parameters) according to your circumstances. #!/bin/sh -e ### BEGIN INIT INFO # Provides: vncserver # Required-Start: networking # Default-Start: S # Default-Stop: 0 6 ### END INIT INFO PATH="$PATH:/usr/X11R6/bin/" # The Username:Group that will run VNC export USER="YOUR_USERNAME" #${RUNAS} # The display that VNC will use DISPLAY="1" # Color depth (between 8 and 32) DEPTH="16" # The Desktop geometry to use. #GEOMETRY="<WIDTH>x<HEIGHT>" #GEOMETRY="800x600" #GEOMETRY="1024x768" GEOMETRY="1280x1024"
wordpress.com//vnc-server-ubuntu- 3/5

10/1/2010

How to install VNC server on an Ubuntu

# The name that the VNC Desktop will have. NAME="your-vnc-server" OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" . /lib/lsb/init-functions case "$1" in start) su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" ;; stop) su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0 4. Make the above script executable: sudo chmod +x /etc/init.d/vncserver 5. Make thisscript into a system service by adding thisscript to the runtime scripts invoked at bootup time. sudo update-rc.d vncserver defaults 6. To start the service without rebooting the SERVER: sudo /etc/init.d/vncserver start 7. If you made a mistake/typo in the script, you can undo the creation of the system-wide service (step 5) by running the command: sudo update-rc.d -f vncserver remove You may then correct your mistake and then repeat steps5and 6. 8. Well done! You may now connect to your Ubuntu PC SERVER via remote desktop by simply powering on the SERVER and giving it enough time to bootup and run all of its system-wide services.

References References
wordpress.com//vnc-server-ubuntu- 4/5

10/1/2010

How to install VNC server on an Ubuntu

1 ^ UltraVNC Remote Desktop Software (www.uvnc.com) . 2. ^ VNC Server asservice (www.abdevelopment.ca)


Excerpted from How to install VNCserver on an Ubuntu PCand remote connect toit from a WindowsPC the seekerquill s http://theseekersquill.wordpress.com/201 0/03/1 6/vnc-server-ubuntu-windows/

Readability An Arc90 Laboratory Experiment http://lab.arc90.com/experiments/readability

wordpress.com//vnc-server-ubuntu-

5/5

Potrebbero piacerti anche