Is it possible to access windows network printers from a VirtualBox WindowsXP client running under Ubuntu 10.10 host?

The networking type is NAT.

Would Bridged Networking solve the problem? If so, is there a tutorial on how to set up bridged networking for virutual box?

link|improve this question
feedback

1 Answer

Yes, a bridged interface would solve the issue, however there is another solution made available because linux is so flexible, to use the ubuntu host as a gateway to access the whole network. This can be accomplished with iptables:

iptables --table nat --append POSTROUTING --out-interface $hostInt -j MASQUERADE

iptables --append FORWARD --in-interface $vboxInt -j ACCEPT

echo 1 > /proc/sys/net/ipv4/ip_forward

Just replace $hostInt with your host machine's network interface, such as eth0 or wlan0. Replace $vboxInt with the virtual interface for the local machine.

link|improve this answer
Cool! Thanks! Will iptables forwarding work in NAT mode? Apparently the latest version of virtualbox (4.8) now makes it easier to set up bridged networking: i managed to get it running by loading the filtering module with sudo modprobe vboxnetflt; on ubuntu/debian this can be made persistent by adding vboxnetflt to /etc/modules. – ccpizza Jun 7 '11 at 9:59
feedback

Your Answer

 
or
required, but never shown

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