Linux - Virtualization and CloudThis 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.
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.
How do i connect to my guests from the host...or anywhere else for that matter?
I've started running KVM on my PC, which has 2 NICs installed.
The guest is bridged, using virtio, to eth0 and the host is set to use eth1 for normal internet activity.
So far everything seems to be working correctly, i.e they can all connect to the internet. Now I've disabled the firewalls on the guests and allowed all connections for eth0 on the host but I can't/don't know how to connect to the services running on them(sendmail and apache). Netstat on the guests show that the correct ports are open.
Am I meant to be connecting to the IP assigned to eth0?
I use VirtualBox, so I'm not sure how much applies to you but here goes. I have 2 nic's on my desktop. One for the host system, one for the VM's. I have a script (that I don't have access to right now) that runs at boot and creates a bridge adapter. I know I probably don't need to do that but, oh well. So I end up with 3 interfaces: eth0, eth1 and br0. In VBox, I have my VM's use the br0 adapter and my network is set up with static ip's. Now, my VM's can access anything on the network just like any other machine and my host machine can access all the vm services as well.
Code:
#!/bin/sh
# This script is for starting our bridge interface for our
# virtual machines
/sbin/modprobe tun
# First, set up eth1
ifconfig eth1 up
ifconfig eth1 0.0.0.0
# Create our bridge and add the interfaces
brctl addbr br0
brctl addif br0 eth1
# Bring interface br0 up
ifconfig br0 up
# Create tun devices for vbox and add them to the bridge
echo "Creating VirtualBox tun devices..."
VBoxAddIF vbox0 $USER br0 &>/dev/null
Last edited by manwichmakesameal; 10-20-2009 at 07:06 PM.
Reason: added script
I haven't had a chance to check my initialization scripts yet, but it sounds like our setups are similar, as I also get the 3rd interface, virbr0.
What I can't get my head around is:
Wireshark shows that all outgoing traffic from the guest goes through 192.168.0.10 on the LAN(which is assigned to eth0). Incoming traffic does the same, but only because the connection was initiated by the guest.
So if I tried to open a connection to 192.168.0.10 on port 80 from another PC on the network, it tries to connect to the host and not the guest which is the one running the apache service.
Is this where tun/tap comes into play?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.