Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using virtualbox 4.1.16 on a Ubuntu 12.04 x64 vm host and all NAT is working properly, like HOST 2222 -> Client 22

But I have changed my HOST sshd to listen on port 81 and restarted, so host port 22 is free. and order my guest vm to do a NAT (HOST)22 to (CLIENT)22. while the same vm guest, if I map NAT 1234 to 22, it works again.

I have tried ufw disable, /etc/init.d/apparmor stop, nothing helps

Is there anything I need to do to make it happen?

share|improve this question
promblem remains but I have found a workaround by port forwarding using iptables iptables -t nat -A PREROUTING -i eth0 -p TCP --dport 22 -j REDIRECT --to-port 1234 – c2h2 Jul 5 '12 at 7:04

This sounds like your VirtualBox process is not running with the right privileges allow it to bind to ports below 1024 - typically that requires root level permissions. According to the VirtualBox manual, there are four limitations to the NAT engine:

  • ICMP protocol limitations, ping works but a lot of things may have trouble
  • Receiving of UDP broadcasts is not reliable
  • Protocols such as GRE are unsupported
  • Forwarding host ports < 1024 impossible on Unix hosts like Linux, Solaris, Mac OS X without running as root.


The best workaround would be to configure your virtual machine to use a bridged virtual network adapter if that will work in your environment.

share|improve this answer

Your Answer


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.