So anyway, this took a lot of setting up.
- You can skip most of this and use host networking on one of the Ethernet adapters. The problem is that if the network goes down, you are hosed.
- First, get the virtual networking software from http://tuntaposx.sourceforge.net. Restart the computer after install and it should be running (without any changes).
- Time to set up the virtual network adapter. Note: you'll need to do this BEFORE running the VirtualMachine (otherwise it cannot bind or something) and you need to keep this shell window open. Otherwise you are killing the network adapter. Also note, the first and second group of instructions are from here with no real changes.
# might need to enter pass here
exec 4<>/dev/tap0 # opens device, creates interface tap0
ifconfig tap0 10.10.10.1 10.10.10.255
ifconfig tap0 up
dd of=/dev/null <&4 & # continuously reads from buffer and dumps to null
- do not close that window (if you type jobs you'll see the buffer reading is continuing in the background)! In fact, leave it alone. Open another terminal window. (Note: make this into a shell script by stripping off the sudo command, which you'll have to type, and dumping the contents in whatever.sh. Then you can run source whatever.sh)
- Now you need to alter the virtual machine. We do this stuff once to get the VM set up. List the VMs
- Now you'll need to pick the name of your machine of interest from the big text wad it throws you. It's the natural name, like you see here:
VBoxManage modifyvm "that craazy linux box mon" -hostifdev2 tap0: # connect that adapter to tap0: which is our virtual network (exciting, eh?)
- Now we're almost done. In fact, if your machine boots, it means that the adapter is there and you can almost get moving.
- Configure Linux for the adapter
sudo nano /etc/network/interfaces
# add these lines
auto eth1 iface eth1 inet static address 10.10.10.200 netmask 255.255.255.0 # netmask works, but it could be better I think
# restart networking
sudo /etc/init.d/networking restart
- Now if that worked, you should be able to ping 10.10.10.200 from your host.
- Edit /etc/hosts and put in a line that says
- and now try pinging virtbox (ping virtbox) from the host
- Now set up MySql so it's friendly (from my old instructions):
- Now, getting MySql to work. Change the /etc/mysql/my.cnf
bind-address = 10.10.10..200
which used to be localhost
- from the MySql client (you must be root!)
grant all privileges on *.* to 'root'@'10.10.10.200';
- Restart MySql: sudo /etc/init.d/mysql restart
- Now you can connect with MySql from your host using the command-line thinger or the MySql Query whatsamagig