Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Use vnc to avoid X11 / OS X desktop clutter Apps
You can use vnc (Virtual Network Computing) to gain access to your X11 desktop and reduce desktop clutter in general. In an X11 terminal window, install the X11 vnc via Fink (fink install vnc). Then type vncserver :2 -localhost; enter a password and confirm. You can then exit the X11 terminal. This will run the vncserver on display 2, using the default settings, and only allow connections via the localhost. The vncserver installed by Fink will only display X11 windows, not your OS X desktop.

To connect to the vnc server, type vncviewer localhost:2 at an X11 terminal prompt, and enter the password when prompted. You will then have your X11 desktop, and it should be running twm as its window manager. You can change this (I set mine to icewm, installed through Fink) by editing ~/.vnc/xstartup and changing the line:
  twm &
to (for example)
  icewm &
to use the Ice Window Manager. I have also used KDE and Gnome with this method, all installed from Fink, but icewm seems to be the most responsive. So why bother with vnc on localhost?

Well, the state is retained when you close the viewer window, which means you can leave all your X11 apps running without cluttering your screen, and when you need them again, simply reconnect to localhost:2 and there they are. You can also, using SSH, access your desktop from anywhere in the world, by using port forwarding:
  ssh -C -L 5902:localhost:5902 user@mac.ip.address
The -C enables compression over the connection, which will help speed things up (replace user and mac.ip.address with the proper values for your machine). You then connect to the vnc server using a viewer on the local machine, again with the command vncviewer localhost:2, and there's your home desktop, with the X11 apps still running as you left them.

Hope this helps!

[robg adds: I modified this hint just a bit to refer to "X11" instead of the originally written "X" where appropriate, in order to reduce the confusion between the two environments. To learn more about X11, check out the XFree86 homepage and Apple's X11 page.]
    •    
  • Currently 3.25 / 5
  You rated: 3 / 5 (4 votes cast)
 
[12,488 views]  

Use vnc to avoid X11 / OS X desktop clutter | 13 comments | Create New Account
Click here to return to the 'Use vnc to avoid X11 / OS X desktop clutter' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Why?
Authored by: sgi_oh_too on Apr 17, '03 10:52:50AM

Why not just use a vnc client of mac os x and just skip using X11 at all? Seems ridiculous to use X at all if you are using vnc anyways.

Furthermore, explain why remote X sessions are bad and why you would want to use horribly slow (in comparison) vnc?

Remote X sessions are one of the really cool features of X. I understand using vnc for windows machines (since terminal services is a pain and not truly free) ... but for X I don't understand why since X sessions are just fine.



[ Reply to This | # ]
Why?
Authored by: eagle on Apr 17, '03 11:38:42AM

Just try running an X Window System session over a slow link and you'll
see the problem with the X Window System, and why vnc is so desirable.



[ Reply to This | # ]
Why?
Authored by: truhe on Apr 17, '03 12:18:13PM

I used StarOffice 5.2 over a 33.6 modem connection with x11 tunneled through ssh with maximum compression. it took a while to load all damn toolbar icons, but after that I was able to work with StarOffice like with a local application! Scrolling, typing etc., everything was smooth. Toolbar switching took some time though :).

On a total different side are kde-apps, which take hours for loading and then are unusable. kmail seemed to be a huge bitmap, including fonts.

At work I work with PC Anywhere and connect to a customer using a ISDN connection. I'd love to use X11 instead, because PCA is totally slow compared with.



[ Reply to This | # ]
Why?
Authored by: eagle on Apr 17, '03 12:41:28PM

Being a Mac- & Unix-only guy, I don't have any experience with PC
Anywhere, but I have found both VNC and Timbuktu to have acceptable
performance over a link that slow. Perhaps you could get your customer
to try one of those options?



[ Reply to This | # ]
Huh?
Authored by: macubergeek on Apr 17, '03 03:55:14PM

I've read all the comments and I still don't understand why you would use vnc for LOCALHOST connection? sounds unnecessary.



[ Reply to This | # ]
Huh?
Authored by: Wheaty73 on Apr 18, '03 12:07:44AM

Like I said, it keeps your X11 session seperate from your X
session, reducing clutter on your desktop. All your X11 apps will
continue to run, even if you quit Apples X11.app, or log out, in
their own vnc workspace. This is great if you need to let
someone else use your machine!

By only allowing connections to localhost, it is also more secure
since you will either need to be logged in to the machine, or port
forwarding through SSH.

Wheaty



[ Reply to This | # ]
Huh?
Authored by: Wheaty73 on Apr 18, '03 01:30:05AM

Ah! Sorry, I have just realised what you meant.
Running vncserver :2 forces it to draw its windows on display 2,
which since I don't have 3 monitors, is a virtual display (this is
how it prevents desktop clutter). To view this display, I need to
connect to it, by telling the viewer to look at display 2 on the
local machine. When I close the viewer, the vncserver continues
to run on its virtual display so all the X11 applications stay in
the state I leave them.

HTH

Wheaty



[ Reply to This | # ]
Why?
Authored by: readparse on Apr 17, '03 07:34:42PM

X11 rocks. VNC rocks. Depends on what you need and why. I happen to agree with you about X11, but VNC truly rocks.



[ Reply to This | # ]
Why?
Authored by: kerouassady on Apr 18, '03 08:45:30AM

For you people who still don't get this, think like the way Windows uses Terminal Services and the concept of workspaces.



[ Reply to This | # ]
man ssh
Authored by: readparse on Apr 17, '03 07:37:55PM

The ssh man page recommends the -C switch only for "modem lines and other slow connections". Using it on fast networks actually slows the session down, because the network speed makes the compression the bottleneck (not to mention the encryption, but we'll let that slide :)



[ Reply to This | # ]
Er...
Authored by: MattHaffner on Apr 18, '03 12:40:20PM

This is a neat hint, but if you're only doing this to reduce clutter, why not just use the Hide X11 menu option? All the X11 window go away and clicking on the dock icon brings them back...

Certainly, if you don't like the mixing of X11 and Aqua windows, this is an idea, but then I wonder if the old XDarwin functionality of the Rootless screen option wouldn't be better. I'm not sure the Apple X11 server can do this though (haven't investigated it).

The real advantage is, of course, if you go home, you can VNC in and only connect to your X11 session without disturbing the Aqua session you have running there.



[ Reply to This | # ]
where is the vnc package???
Authored by: jevv on Apr 22, '03 09:01:35AM

hej, you sure you got vnc with fink? There is no vnc package in the fink package list ....



[ Reply to This | # ]
where is the vnc package???
Authored by: samson on May 23, '03 04:45:46AM

The vnc package (and the improved tightvnc package) are both in the unstable tree, which is not searched by default in fink. To enable searching of the unstable tree, check

http://fink.sourceforge.net/faq/usage-fink.php#unstable

for some options.

/sam



[ Reply to This | # ]