LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
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


Reply
  Search this Thread
Old 09-16-2011, 12:18 PM   #1
dashesy
LQ Newbie
 
Registered: Aug 2011
Posts: 12

Rep: Reputation: Disabled
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 12:22 PM. Reason: added P.S.
 
Old 09-18-2011, 12:24 AM   #2
tristezo2k
LQ Newbie
 
Registered: Oct 2009
Distribution: debian ubuntu solaris FreeBSD
Posts: 26

Rep: Reputation: 4
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.
Old 09-19-2011, 10:32 AM   #3
dashesy
LQ Newbie
 
Registered: Aug 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
Old 09-19-2011, 11:59 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
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
 
Old 09-19-2011, 08:12 PM   #5
scheidel21
Senior Member
 
Registered: Feb 2003
Location: CT
Distribution: Debian 6+, CentOS 5+
Posts: 1,323

Rep: Reputation: 100Reputation: 100
You would need to bridge the network adapter in the VM instead of host only. That or NAT and port forward the port(s)
 
Old 09-20-2011, 10:10 AM   #6
dashesy
LQ Newbie
 
Registered: Aug 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
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.
 
  


Reply

Tags
port forwarding, qemu, virtual box



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Shorewall: port forwarding problem, port is closed even after forwarding Synt4x_3rr0r Linux - Networking 2 12-13-2009 04:36 PM
LXer: Tech Tip: Port Forwarding in Virtualbox with VBoxManage LXer Syndicated Linux News 0 09-10-2009 11:20 PM
Limting openssh port forwarding per user onaias Linux - Security 4 01-10-2004 05:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration