Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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 have a VM in VirtualBox running a Ubuntu 64-bit server that I want to use as a test/local server. I have mysql installed in the VM and am managing it using MySQL Workbench installed on my host laptop (Windows 7 64-bit).

I have it setup currently where anyone who knows the root password can login to mysql as root from any machine (added an entry to the permissions table with root at location %, commented out all bind-address lines in my-cnf), but what I'd really like to have is a situation where root access is only allowed from my host machine and from the VM. I want to maintain the ability to communicate with my VM from any computer in my local network (which I have right now), and the host machine must be able to have a dynamic IP.

The VM server is currently setup to use a Bridged Adapter network (hooked to my host wifi driver) and has a dynamic IP as well, though I don't see this being a requirement as long as my VM server can still access the internet for software updates and the VM and host machine can communicate back and forth with each other (for putty access, mysql maintenance, local webpage server, etc.).

How would I go about doing this, and is it even possible? Let me know if there's any other info I should post.

share|improve this question
up vote 0 down vote accepted

So I think I've figured out an acceptable solution (original source: Host-Only Networking with VirtualBox).

I created 2 network adapters, one which hooks up to my DHCP addressed Bridged Adapter and the other hooks up to a Host-only interface. I'm not exactly sure how routers and DHCP's assign addresses, but they all seem to be some variant of 192.168.*.* for private networks, but from what I understand the address space 10.*.*.* also are reserved for private networks.

So I set my Host Network to IPv4 address to in VirtualBox with an IPv4 network mask of I also turned off the DHCP server for the host network.

I next modified my etc\network\interfaces file as such:

# The primary network interface
auto eth0
iface eth0 inet dhcp
# This is an autoconfigured IPv6 interface
iface eth0 inet6 auto
# Host only connection
auto eth1
iface eth1 inet static

Now anything I want to limit to only be modifiable from the host PC can be statically addressed as

For example, in MySql I added all permissions for root@ instead of root@%.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .