VM's get ip from router?

Discussion in 'sandboxing & virtualization' started by pwr, May 24, 2010.

Thread Status:
Not open for further replies.
  1. pwr

    pwr Registered Member

    Joined:
    Dec 1, 2006
    Posts:
    70
    Edit: managed to get it working. I didn't know where to create the bridge between the adapters, in w7.

    Is it possible for my virtual machine (VirtualBox or Virtual PC 2007, have tried both) to get an ip from my router so that my physical PC is on the same network as the virtual machine?

    I've been trying all kinds of things, but none work =/

    I've tried to get bridged networking to work in VirtualBox, thinking that it might do the trick - but I haven't been able to.

    I run W7 64 btw.

    Oh well,

    Thanks.
     
    Last edited: May 24, 2010
  2. moorgeist

    moorgeist Registered Member

    Joined:
    Aug 9, 2009
    Posts:
    5
    Are you running "Virtual PC 2007" or "Windows Virtual PC" (the successor for Windows 7)?

    I run "Windows Virtual PC" with Windows 7 64bit. If you set "Adapter 1" in the "Networking" settings to the physical adapter that is connected to the network, the virtual machine should appear as just another physical machine in your network.

    Check the info link "More about networking and virtual machines" on the "Networking" settings page.
     
  3. pwr

    pwr Registered Member

    Joined:
    Dec 1, 2006
    Posts:
    70
    Just VirtualBox, But I also tried Virtual PC 2007. I didn't try the one you mentioned because I then had to also install XP mode which I don't really need.
     
  4. wat0114

    wat0114 Guest

    Based on the documentation, I don't see how it's possible with VBox. I use it and have not seen where it's possible out of the 6 networking modes available. The closest looks to be "Bridged mode" but even at that I think it's only the host's network adapter that will be assigned the ip by the router. A couple of the other modes use a loopback type method on the host, so that won't get your vm an ip from the router either.
     
    Last edited by a moderator: May 24, 2010
  5. pwr

    pwr Registered Member

    Joined:
    Dec 1, 2006
    Posts:
    70
    I'm on Windows 7. I got it to work by creating a bridge between the physical nic and the vbox fake nic by selecting both of them and then right clicking and selecting create bridge. I then assigned an ip address to the bridge (I use static ips instead of dhcp).

    In vbox I selected bridged, and the only choice that appeared then - was the newly created bridge (MAC Bridge Miniport, it says). Then in vbox I was able to set a static ip address (192.168.1.111, router being 192.168.1.1 and PC 192.168.1.100), on the same network as my physical nic.

    I can ping the vm from the phys, and vice versa. I can even connect to the vm via remote desktop on the host. I can also connect to the router and configure it etc. from within the vm.
     
  6. wat0114

    wat0114 Guest

    Cool and nice find :cool: I'll have a play later. Thanks for the info :)
     
Loading...
Thread Status:
Not open for further replies.