# Can you allow the host to use the VM network connection?



## MatteusBlanc (Mar 23, 2011)

beyond_amusia said:


> Okay, I'm using Windows 7 and XP mode, with a Verizon card because my crappy DSL got shut off... That catch is that the x64 drivers are not signed, so I cannot use the card in 7, but I can use in in XP via Windows VPC (how I am accessing this)... I am wondering if I can share the card from XP Mode into 7??? I looked in network places and the 'host' does not show up at all, so I really have no idea where to get started on this if it is even possible.
> 
> EDIT: I am going to try the steps MS provides for getting the card to work in 7 here: http://social.technet.microsoft.com...e/thread/d5b4340a-70d4-4eab-9a6e-50088a56d2ef  I will post back letting everyone know how is goes.



If you use a VM...

this is possible although not immediately obviously useful. My situation was one where the vm os was able to change settings on a wireless network adapter which allowed me to pick up the signal at a useable strength. The host could not do this. So I was in the weird situation where the vm os - backtrack - had internet but the host - osx 10.6 - did not. Annoying.

Easily corrected as follows:
1. connect the vm to the network, in my case this was wireless so wlan0
2. set up the vm so that is has a local network with the host, make sure the host can ping the vm. In my case this meant enabling eth0 in the vm
3. set up ip forward and iptables masquerade rules on the vm.
4. change the default route of the host to be the vm local ip
5. enjoy the vm network via the host


now I imagine some readers will want more detail on ip forward and masquerade with iptables but there are a lot of tutorials out there for this stuff. It depends on the vm os but if you are using linux then 

ip forward with: 
$ echo 1 > /proc/sys/net/ipv4/ip_forward

iptables rules something like this
iptables -t nat -A POSTROUTING -s $PRIVATE -o eth0 -j MASQUERADE

{clearly $PRIVATE is your private subnet, set the rules up to run at ifup}


----------



## Easy Rhino (Mar 23, 2011)

that is pretty damn clever.


----------

