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.

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?

share|improve this question

1 Answer 1

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.

share|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

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.