NAT dns failed of VirtualBox 4.1 on Ubuntu 12

After upgrade to Ubuntu 12.10, the NAT settings failed of VirtualBox VMs. Resources from Internet shown that it caused by Ubuntu changes the way the resolv.conf works. However in my desktop, it ONLY happened since this upgrading. From this reference, they said the local dns resolver switch to rather the old one,

There are much more feasible solutions on the Net: install dnsmasq, alter the interface settings of Ubuntu, etc. In my opinion, the problem only affected to VirtualBox and it is patched in the next release (4.2) that I use the simplest way: change per VM settings if it need of which is not shown in GUI settings. Steps are simple:

  1. Shutdown the VM you want to alter
  2. Open terminal and use the following command to enable resolver
    VBoxManage modifyvm "{the vm's name}" --natdnshostresolver1 on

. This command will alter the vbox’s XML settings and it works fine. Enjoy it. 🙂

SSH connection starts up slowly

The situation is: when connect to a server with SSH session, it starts up slowly (but the web connection is fast). For some tracing and debugging, it is due to the stupid DNS setting by someone.

The reference is – SSH session slow to start? It’s the DNS stupid!, and the solution listing:

1. Check for the DNS settings in /etc/resolv.conf or NetworkManger in Gnome or any management tools on desktop environment. Or
2. Set the ”UseDNS no” in sshd config: /etc/ssh/sshd_config, and then restart sshd.

Enjoy it. 🙂