TurnKey Linux Virtual Appliance Library

port forwarding with VBoxManage for portable appliance

Hi, Turnkey is amazing, almost exactly what I was looking for.  My main issue is that I want to make the appliance portable, I'd like to use it for a local dev tool on my laptop.

Running: Virtualbox 3.0.8

Installed the LAMP appliance. 

I don't think that Bridged networking will work if I carry my laptop to another wireless LAN.  And if it does, i'll probably get assigned a new IP or have some kind of collision. 

I saw these 2 posts discussing how to do port-fowarding with virtualbox vboxmanage:

http://sk.c-wd.net/wp/2008/08/17/virtualbox-port-forwarding-with-windows...
http://thedrupalblog.com/setting-nat-and-port-forwarding-connect-virtual...
 

However, I'm stuck.  I followed the instructions in the above posts, to use VBoxManage to forward ssh/http ports.  When I startup the turnkey VM, I'm being given 10.0.2.15 as the IP for the LAMP appliance.  The IP of the host machine is 192.168.1.104 - am I supposed to assign the same IP to the VM?  I've turned off the bridged network and am just using NAT.

I'm not quite sure how to do this.  Any ideas?

 

Liraz Siri's picture

Ideas

If you're using your VM just as a development tool I recommend you use a "host-only adapter" in VirtualBox's network settings. That's what I do when I'm offline. This way your VM gets a private network address (e.g., 192.168.56.2) that only allows your host to connect to it.

Also, keep in mind that by default TurnKey Linux uses DHCP. If you start up the machine in bridged mode on a different network it should just give you another IP adderss which you can then connect to. The main advantage to using bridged mode is that you can then connect from your VM to the network your host is connected to and download files from the Internet, install packages using apt-get, etc.

Finally, it's a little known fact, but VirtualBox supports TCP port forwarding.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)