Serendip is an independent site partnering with faculty at multiple colleges and universities around the world. Happy exploring!

You are here

Remote Desktop

Kathy Maffei's picture
Projects: 
On Doug's advice, I've used vnc in past courses to get a remote desktop to work from home on my Windows machine. I'd had problems with changes in security, but last night I got it running just fine. Of course, there's a bit of delay, but it's quite nice. Lucid Life is almost as impressive as in class, and python CAs pop up nicely. I'm using a cable internet connection at home, so I'm not sure what a dial-up would look like... In case someone else would like to try it, I figured to document it here. I’ll describe it in detail for anyone not already familiar with these programs. I'm using PuTTy (a free, non-installed executable) to create a secure shell to one of the lab computers. The shell needs to create a tunnel through which the vnc client will connect, since BMC security blocks vncserver requests otherwise. So, in your PuTTy settings under Connection -> SSH -> Tunnels, you need to create a Forwarded Port: 1) Type in any 4-digit # you like for Source Port (and remember it) 2) Under Destination, type in the machine name you're connecting to, a colon, and 5901 (eniac.brynmawr.edu:5901 for example) 3) Click Add Under Session, the Host Name should be the name of the computer you’re connecting to (same as Destination in your Forwarded Port setting - eniac.brynmawr.edu for example) and Protocol should be SSH. You can save your settings by typing in a name under Saved Sessions and clicking Save. Click Open to open the connection. Once you've given your name & password to log onto the lab computer through PuTTy, type "vncserver" at the prompt. The first time you do so, you'll be asked to create a password for your vncserver sessions - you'll need this password every time you run vnc viewer. You'll also be informed that a desktop was created for you on the machine. Here's an example of what it says: New 'trs80.brynmawr.edu:1 (kmaffei)' desktop is trs80.brynmawr.edu:1 Notice that I was given desktop 1. If I had logged in after someone else had already done so and created themselves a vnc desktop, I would have been given desktop 2 (trs80.brynmawr.edu:2) – or 3 or 4, etc. Here's the weird part. Although I've never had to test this theory, I'm told that if I am going to end up with desktop 2, then the Forwarded Port I created in the tunnels section of PuTTy should have been (eniac.brynmawr.edu:5902). Of course, this requires some form of prescience, so I start with 1. I guess if I ended up with 2, I’d try connecting with vnc, anyway, to test the theory. If it didn’t work, I’d have to kill my vnc desktop from PuTTy (type “vncserver -kill :#” – where # is whatever number desktop I was just given), log off the lab computer in PuTTy (type “exit” at the prompt), and reconfigure the Forwarded Port for whatever desktop I figured I’d end up with when I logged back on. Hopefully, I’d do this quick enough that when I logged back onto that computer, I was given the desktop # I expected! I hope we don’t run into this issue, but if enough of us use vnc to log on remotely, then it might happen. Perhaps we can coordinate and each select a different lab computer to log into. FYI, I’ve been using trs80. OK, once you’ve successfully created your vnc desktop with PuTTy, you’ll run VNC Viewer (just like PuTTy, a free executable). You only need the viewer. Open your vncviewer and type into the Server box “localhost::####” where #### is the 4 digit number you chose as a Source Port when you set up the Forwarded Port in PuTTy. Notice the two colons between localhost and the port number. Click OK and you’ll be prompted for a password – this is the one you gave the 1st time you ran vncserver from the PuTTy window. Then your desktop will pop up. There are some quirks to get used to – you have no right-click, and windows are slightly different. When a new window pops up, it’s only an outline you drag with your mouse until you decide where to place it and click on the screen to drop it. Also, I have yet to figure out how to close a window in this new vnc version, so when the python CA pops up the drawing window, I must Ctrl-C in my terminal window to get control back (as someone discovered in class yesterday). There are also some settings under Options in vncviewer before you connect – color and inputs. Cleaning up: once you’re done and you’ve closed your vncviewer, you’ll need to kill the desktop in the PuTTy terminal window by typing “vncserver -kill :#” – where # is whatever number desktop you were using. The reply should be something like: Killing Xvnc process ID 11218 Good luck and please let me know if you discover anything different or additional to what I've written. Doug may have some to add - I think he uses this.