0

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.

1
  • Yuck, apparently Virtual PC NAT only allows outgoing connections from the guest OS.
    – kch
    Commented Aug 8, 2009 at 6:55

2 Answers 2

2

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.

9
  • Couldn't I use the same port number on both sides?
    – kch
    Commented Aug 8, 2009 at 6:44
  • 1
    If you don't have something else running locally on that port, sure, you could.
    – Joey
    Commented Aug 8, 2009 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
    Commented Aug 8, 2009 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
    Commented Aug 8, 2009 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
    Commented Aug 8, 2009 at 7:13
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .