Hi. New VB user here; I'm switching from VMWare and so far am extremely pleased.
This is a simple question, but basically, I'd like to know how to reach a guest machine from the host _only_. That is, I don't need (or want) to expose the guest to the world. I only want to reach the guest from the host, for testing purposes.
I'm running 2.04 on Debian Linux as my host, and trying to reach a FreeBSD guest that's functioning as a database server and web server. Networking is working fine.
Thanks.
Reaching guest from host
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
This is discussed several times. See the manual, chapter 6 for how to set up Host Interface Networking. The bridge is not needed, only an IP address on the Host and Guest side of the HIF.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
OK, I guess I can now confess to not really understanding what is supposed to happen here.
I don't want to set up bridging; among other things, my host is a laptop that's rarely connected by Ethernet. I want the guest to have access to the outside network, so a user on the guest can use the Internet, but no one (apart from the host) needs to reach the guest.
I did run the VBoxAddIF command on my host, and this successfully set up a vbox0. However this interface only had an inet6 address, which I don't use.
/dev/net/tun is a member of the "root" group, not "vboxusers", but the user running VirtualBox is a member of "root" anyway.
I added the vbox0 interface to the guest, as discussed in the manual, but the guest, upon booting, was apparently unable to see this. At least, it couldn't get a DHCP lease, and if there's some other non-bridged way the guest is supposed to see vbox0, it wasn't clear what this is supposed to be, or what, when the process is complete, is the way that the host reaches the guest.
So I would welcome an additional pointer....Thanks.
I don't want to set up bridging; among other things, my host is a laptop that's rarely connected by Ethernet. I want the guest to have access to the outside network, so a user on the guest can use the Internet, but no one (apart from the host) needs to reach the guest.
I did run the VBoxAddIF command on my host, and this successfully set up a vbox0. However this interface only had an inet6 address, which I don't use.
/dev/net/tun is a member of the "root" group, not "vboxusers", but the user running VirtualBox is a member of "root" anyway.
I added the vbox0 interface to the guest, as discussed in the manual, but the guest, upon booting, was apparently unable to see this. At least, it couldn't get a DHCP lease, and if there's some other non-bridged way the guest is supposed to see vbox0, it wasn't clear what this is supposed to be, or what, when the process is complete, is the way that the host reaches the guest.
So I would welcome an additional pointer....Thanks.
So is there any way to do this easily?
Just to restate, my goal here is that I have a laptop host, and want to set up networking such that the guest can use whatever interface the host is using (chiefly wireless), but so that the host can reach the guest for testing purposes. The guest is a web- and database server.
Thanks.
Just to restate, my goal here is that I have a laptop host, and want to set up networking such that the guest can use whatever interface the host is using (chiefly wireless), but so that the host can reach the guest for testing purposes. The guest is a web- and database server.
Thanks.
You can forward the ports. I have several guests running on my host and I port forward the port 22 from the guest to some port 2221, 2222, 2223, 2224, etc. on my local machine. Hence, I can just do "ssh -p 2222 localhost" to log into my VM. This is mentioned in the manual, do a search for guestssh or something like that...
-
Sasquatch
- Volunteer
- Posts: 17798
- Joined: 17. Mar 2008, 13:41
- Primary OS: Debian other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows XP, Windows 7, Linux
- Location: /dev/random
Jester, you have correctly added the HIF, now you need to set a static IP address on both ends. Open your /etc/network/interfaces file on the Host and put a static network setup there, like this:
Now put the same config on the Guest, but change the last number of the IP address. That should give you access to the Guest from the Host only.
Podollb, with Port Forwarding, you give access to the VM from the whole network when they connect to the Host. He explicitly want that only from the Host.
Code: Select all
auto vbox0
iface vbox0 inet static
address 192.168.5.1
netmask 255.255.255.0Podollb, with Port Forwarding, you give access to the VM from the whole network when they connect to the Host. He explicitly want that only from the Host.
Read the Forum Posting Guide before opening a topic.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
VirtualBox FAQ: Check this before asking questions.
Online User Manual: A must read if you want to know what we're talking about.
Howto: Install Linux Guest Additions
Howto: Use Shared Folders on Linux Guest
See the Tutorials and FAQ section at the top of the Forum for more guides.
Try searching the forums first with Google and add the site filter for this forum.
E.g. install guest additions site:forums.virtualbox.org
Retired from this Forum since OSSO introduction.
-
stephanecharette
- Volunteer
- Posts: 300
- Joined: 10. Nov 2007, 22:03
- Primary OS: Ubuntu other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Ubuntu-64bit, Windows
- Location: Kelowna, British Columbia, Canada
- Contact:
Sasquatch,
Many thanks for the help--this is exactly what I needed. I fumbled around for a while stupidly trying to get vbox0 to work in my guest, but eventually realized that I needed to use a network driver available there. So I just configured VB to use a NAT interface with one virtual card, and a HIF interface with the same kind of card, and used le0 and le1 in my FreeBSD guest to attach to them respectively.
And now everything works perfectly, as I need.
Thanks!
Many thanks for the help--this is exactly what I needed. I fumbled around for a while stupidly trying to get vbox0 to work in my guest, but eventually realized that I needed to use a network driver available there. So I just configured VB to use a NAT interface with one virtual card, and a HIF interface with the same kind of card, and used le0 and le1 in my FreeBSD guest to attach to them respectively.
And now everything works perfectly, as I need.
Thanks!