Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-16-2011, 01:18 PM
|
#1
|
LQ Newbie
Registered: Aug 2011
Posts: 12
Rep:
|
qemu vs VirtualBox user/hoset-only networking and port forwarding
I have a Linux server (SSH and Samba) running in VM with static address (192.168.136.222)
I need to access the server (living in guest) from my host machine (Linux or Windoze)
In qemu I use user networking and redirect to the guest ip address, i.e. "-net user,net=192.168.136.0/24 -redir tcp:22:192.168.136.222:22 -redir tcp:445:192.168.136.222:445"
Then I can access smb://localhost as well as ssh to localhost
In VirtualBox the only way I achieved a similar task was using "host-only adapter" and assign static ip to it in the same domain as my guest (e.g. I selected 192.168.136.2). The only disadvantage is that I have to keep the adapter with that static IP address, even when no virtualbox is running. The rest was similar to qemu and worked just fine.
I tried virtual box NAT, but it seems it only works from inside (guest) to host, and I could not redirect host to guest (not at least using Virtualbox port-forwarding dialogue)
Now my question is this:
What is the difference between qemu user networking, and "Virtualbox host-only" networking? are they the same, or qemu does a reverse NAT (in addition to NAT) to allow guest-to-host access?
P.S. I did not know if this is server-related question, or not. If it is I appreciate if admins move this to the appropriate thread.
Last edited by dashesy; 09-16-2011 at 01:22 PM.
Reason: added P.S.
|
|
|
09-18-2011, 01:24 AM
|
#2
|
LQ Newbie
Registered: Oct 2009
Distribution: debian ubuntu solaris FreeBSD
Posts: 26
Rep:
|
Host only provides access from the host to the vm using an especial interface that is exposed to the host.
You can think of it as a virtual interface connected to a virtual switch where the VMs with host only interfaces are connected.
You will need to configure this interface on the same network, or run a router on any of the VMs to be able to access them.
Check
http://www.virtualbox.org/manual/ch06.html
Most of the simple scenarios can be full filled with bridging the interfaces to the physical network on the host.
Regards
Sebastian
|
|
1 members found this post helpful.
|
09-19-2011, 11:32 AM
|
#3
|
LQ Newbie
Registered: Aug 2011
Posts: 12
Original Poster
Rep:
|
Thanks for the reply.
The problem with Host-only adapter is that (because of the static guest server address) I have to assign a static IP address to it, that may conflict with the rest of my network even when no VM/guest is running.
Whereas with qemu I give the network (192.168.136.0/24) on the fly, and assign static IP address in the command-line. So basically when I close my VM the static IP address and network is gone.
I am going to ask my question in the virtualization forum, as it may be more appropriate, thanks
|
|
|
09-19-2011, 12:59 PM
|
#4
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
Hello,
I have reported this thread to be reviewed and moved, if need be. If it is moved, your other thread will be closed in favor of this thread.
Cheers,
Josh
|
|
|
09-19-2011, 09:12 PM
|
#5
|
Senior Member
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323
Rep:
|
You would need to bridge the network adapter in the VM instead of host only. That or NAT and port forward the port(s)
|
|
|
09-20-2011, 11:10 AM
|
#6
|
LQ Newbie
Registered: Aug 2011
Posts: 12
Original Poster
Rep:
|
Thanks, I asked the question here and the answer for me was to use "--natnet1". Because my static IP address is different from the default VirtualBox address range.
|
|
|
All times are GMT -5. The time now is 05:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|