The FreeBSD Diary |
(TM) | Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link. |
VNC - allowing remote access to graphical desktops
16 August 2002
|
VNC (an abbreviation for Virtual Network Computing) is a great client/server software package allowing remote network access to graphical desktops. TightVNC allows you to display X and Win32 desktops on remote X/Win32/Java displays. In short, it will allow me to access my FreeBSD box from my Windows box via an X Windows interface (or the other way around). That's something I've want to do for a while. A friend had told me about VNC, so I went to FreshPorts and did a search for vnc. I chose TightVNC. You should consider the security implication of using VNC over untrusted networks, such as the Internet. If you plan on using VNC over the Internet, you should use SSH or SSL to secure the session. The documentation will direct you to the right place. I already had an up to date ports tree, so I installed TightVNC with this single command: My next step was to install the Windows client from the TightVNC download area. Installation was straight forward and I won't document it here. It's Windows. What could go wrong? But, should you need it, there is a TightVNC for Windows document. In my situation, I'll be running the VNC Server on my FreeBSD box, and a VNC Client on my Windows box. You should note that you can do this the other way around and access your Windows box from your FreeBSB box.cd /usr/ports/net/tightvnc make install |
Starting the server
|
On my FreeBSD machine, I did this:
As you can see, the screen was set to 1024x768. I'll look at changing that resolution later.
The password you just entered must be supplied when you connect to the server.
This password can be changed by running vncpasswd on the server.
|
Stopping the server
|
From
So to kill the server, I did this:
where 1 is the value returned when you started vncserver.
|
Starting the client
|
In the following example, I will be using the TightVNC client. I also tried the VNC client from
http://www.uk.research.att.com/vnc/.
I'm running a client on my Windows box. You should read the TightVNC for Windows document first.
I started the VNC Client by clicking on Start->Programs->TightVNC->TightVNC Viewer (Fast Compression). I then entered the details
of my VNC Server (
Then you will be prompted for the session password which you supplied when you started the VNC server. This
password can be changed by running
If all goes correctly, you should now be looking at an X session running on your FreeBSD box. Here's what it looked like for me:
From here, it's just like you're on the FreeBSD box. |
Changing the screen resolution
|
This was easier than I thought. First, I consulted the vncserver man page.
Then I supplied a value for
|
Changing the Window manager
|
The window manager is started by the ~/.vnc/xstartup script. By default, VNCTight
uses twm as that is available on most Unix platforms. Here is the original script:
My window manager of choice is KDE. To use that, I changed
|
VNC Madness
|
You can connect to the same VNC server session from more than one VNC client. I tried this and fired up
more than one client. You can see the same thing happen in all clients.
WARNING: I've been told that if you connect to the VNC server from within a VNC Client, you will hang the system. |