Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have the following, totally bizarre, please don't ask, setup:

  1. AirPort router
  2. iBook running Virtual PC connected to AirPort
  3. MacBook running RDC connected to AirPort
  4. A Windows XP VM running on Virtual PC with NAT network settings.

I want to access the Windows VM via RDC.

Apparently, latest Virtual PC on latest Mac OS X cannot use Virtual Switch with AirPort, just with ethernet, so the Windows VM is running on NAT. So it's not directly connected to AirPort, hence, not on the same network as the MacBook.

Can I use SSH port forwarding to somehow make the VM on the iBook accessible to the MacBook? What the magic line would be?

Notice

The accepted answer does not work for the very specific situation described here, see my answer for details. However, as a general solution involving other virtualization software, it works great.

share|improve this question
    
Yuck, apparently Virtual PC NAT only allows outgoing connections from the guest OS. –  kch Aug 8 '09 at 6:55
add comment

2 Answers

up vote 2 down vote accepted

Yup. This shouldn't be any different than other SSH tunnels, really.

I'll use hostnames since I don't know what your internal IPs are :).

ssh -L 13389:virtual_pc:3389 kch@ibook

The virtual_pc address should be whatever the ibook knows how to connect to it as. The port 13389 can be any port you like, it will be opened on your local system through the ssh tunnel. You can also put this in your ~/.ssh/config file on your Macbook:

Host virtual_pc_rdc
  Hostname ibook
  User kch
  LocalForward 13389 127.0.0.1:3389

In both cases replace kch with your actual username, of course. After adding this to your config, you will get the same SSH tunnel with:

ssh virtual_pc_rdc

Use whatever hostname you like instead in the Host line of the config.

Once the connection is made, you can point RDP to localhost:13389 for the connection. Caveat, I don't know RDP software that well, but you should be able specify a different port.

share|improve this answer
    
Couldn't I use the same port number on both sides? –  kch Aug 8 '09 at 6:44
1  
If you don't have something else running locally on that port, sure, you could. –  Joey Aug 8 '09 at 6:57
    
What Johannes said, I typically start my local ports with 1 like that so I don't confuse where I'm connecting to... I run a lot of various services for a test lab :-). –  jtimberman Aug 8 '09 at 7:01
    
Well, the tunnel works great. Now I have to figure out a way to connect from the ibook to the vm. See comment on the question. –  kch Aug 8 '09 at 7:03
    
That part I dont know, I've never used Virtual PC (it bluescreens Windows 7 when I try to run the XP image provided by MS). Any way you could switch to a different virtualization platform? VirtualBox is free and works on OS X... –  jtimberman Aug 8 '09 at 7:13
show 4 more comments

Well, jtimberman's answer is great, unless you're in exactly my situation, then you're SOL.

Problem is: Virtual PC won't do Virtual Switch (Bridged) to AirPort, only to ethernet. Also, only if ethernet is actually plugged to something. (Which makes it impossible to use the Mac's NAT internet sharing)

When using Virtual PC's NAT, it'll only allow outgoing connections from the guest OS, so one can't RDC into it.

So, if you're using a more reasonable virtualization thing like VMware or Parallels, do check jtimberman's answer.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.