Howdy all,
So I’ve done quite a bit of research, and thanks to a lot to this forum, other forums, a few websites, and copious amounts of trial and error, I’ve got a solution to get almost painlessly get VNC up and running on openSUSE 11.1. There’s one minor hitch, but that’s at the very end, and I’m hoping all of you will be able to suggest ways to fix it.
So, let’s dive right into Todd’s Guide to get VNC up and running on openSUSE 11.1.
- Login in as someone who is not root.
- YaST -> Software -> Software Management. Search for “vnc” and then make sure that “tightvnc” and “xorg-X11-Xvnc” are selected and up to date. I right-clicked both packages and selected “Update” from the context menu just to be sure.
- Restart.
- YaST -> Network Services -> Network Services (xinetd). Make sure all every service that has to do with VNC is off. Hit Finish. Now go back to YaST -> Network Services -> Network Services (xinetd) and turn on just the first VNC services (which would be vnc1 and vnchttpd1).
4)YaST -> Network Services -> Remote Administration (VNC). Make sure that the radio button next to “Allow Remote Administration” is selected, but that “Open Port in Firewall” IS NOT SELECTED. (I know, I know, but keep reading.) - YaST -> Security and Users -> Firewall. Go to the “Allowed Services” entry on the list to your left. Make sure that “External Zone” is selected. In the list provided, you may see a few entries that have to do with VNC. Delete all entries related to VNC. Hit Next, then click Finish.
- YaST -> Security and Users -> Firewall. Go back and make sure that this list is clear of all VNC items. Once it’s clear, under the drop-down box entitled “Service to Allow” you should see 3 things that have to do with VNC:
-VNC
-VNC Server
-VNC mini-HTTP server
Select only “VNC” and then click Add. The only allowed service should now be VNC. Hit Next, Hit Finish. - Close out YaST, open up Terminal.
6.1) Type vncserver.
6.2) Set a password.
6.3) I chose not to allow “view-only” mode, so I didn’t need to set a password.
6.4) Once finished, you should be brought back to the Terminal. - Type this:
mkdir ~/.vnc
- Then this:
vim ~/.vnc/xstartup
- In vim, write the following if you’re using KDE 3.x:
#!/bin/sh
/usr/bin/kde &
Or the following if you’re running KDE 4:
#!/bin/sh
/usr/bin/startkde
- Save and quit vim.
- Once back in Terminal, type
vim ~/bin/vncservice.sh
- And then type this:
#!/bin/sh
rm /tmp/.X11-unix/X*
vncserver :7 -depth 16 -geometry 1024x768
- Save and quit vim.
- Once back in Terminal, type the following
crontab -e
- This should bring up vim again (or whatever your editor is). Add the following line to your crontab
@reboot /home/YOUR_USER_NAME/bin/vncservice.sh
Of course, making sure to replace YOUR_USER_NAME with the user you’re currently logged in as right now.
16) Save and quit vim.
17) Close Terminal.
18) Restart.
After your server restarts, you should notice two things:
First, connecting to SERVER_IP:5901 works. Even though the radio button under YaST → Network Services → Remote Administration (VNC) → “Open Port in Firewall” IS NOT SELECTED, it still works. You can connect using a standard VNC client (I’m using JollyFastVNC from Mac OS 10.5), and you’ll be presented with a standard login screen just as if you were actually there at the keyboard/monitor/mouse. I’m not sure why this is working in the first place (shouldn’t the firewall be blocking this?) but that doesn’t seem to bother me so much. I can just go back and disable the service under YaST → Network Services → Network Services (xinetd). What bothers me is the fact that persistent sessions don’t seem to work… If you close out the JollyFastVNC window, and you’ll lose the connection and your session. You will be able to reconnect to the server, but you’ll be presented with the login screen again - you won’t actually be able to resume your session where you left off.
The second thing you’ll notice is that, connecting to to SERVER_IP:5907 works (as you would have expected), but this time, instead of being presented with the login screen a la :5901, you’ll first be asked for the password you set in step 6.2, and once supplied, you’ll automatically get kicked straight to a desktop (without any login screen). When the command “whoami” is issued on the Terminal, you’ll be told that you’re the same user who performed all of the above steps. Closing the JollyFastVNC window and then reconnecting will yield a persistent desktop (i.e.: if you open up a text editor and type something, after closing then reconnecting, you’ll find your desktop and text editor haven’t gone anywhere with all your work intact just as you left it.). While this is what I want, it’s not very secure, and won’t work in environments with more than one user.
Thanks to this forum, as well as the help of many others, I’ve gotten this far, but I’m stuck on the last step… How do I keep my persistent sessions (a la :5907), but still force those connecting via VNC to login via the login screen (a la :5901)?
I’m sure it must be an easy fix, I just don’t know how to go about it.
Sources:
VNC HOWTO - openSUSE
TightVNC (VNC Xvnc) on openSUSE as Client or Server (Remote Desktop Connections)
VNC in OpenSUSE 11 - openSUSE Forums
How to add another Gnome or KDE session at the login screen? - Ubuntu Forums
VNC Hell - openSUSE Forums