Cannot Connect to Guest

expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Cannot Connect to Guest

Post by expirobo »

My setup:

/etc/network/interfaces
Server (HOST):
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface

auto br0
iface br0 inet static
address 192.168.1.100
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

I setup using your script the ip address as 192.168.1.101 for my guest ubuntu
I can start the guest, but cannot connect via ssh. I can ssh into my HOST machine ssh 192.168.1.100, but not 192.168.1.101. "No router to host". What can I do the get this working.

Also, I can ssh into the host machine using ssh 192.168.122.1. What is this? Is the host running another subnet? Should I use 192.168.122.2 or something for my guess OS's?

I am trying to simply setup my host to run virtual linux installs that I can see on my local network as:

Host: 192.168.1.100
Guest1: 192.168.1.101
Guest2: 192.168.1.102

etc.. Any help would be great. I am not using a GUI, only the command line.

Thanks in advance!
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Cannot Connect to Guest

Post by Ian »

Hello there and welcome to the forums :thumbup:

Not sure what to say about being able to connect on 192.168.122.2. I presume you only have the one NIC? Not seen such a thing before, sorry. :oops:

Can you ping your guest on 192.168.1.101?

Does virsh --connect qemu:///system list --all show it running?
expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Re: Cannot Connect to Guest

Post by expirobo »

when I ping it I get destination host unreachable.

I followed your setup exactly and the only other thing I have installed on the system is mediatomb (on host).

The virsh --connect qemu:///system list --all shows it running. Is there a way I can connect to it from the HOST server. If I ssh into host, can I issue some virsh command or something to connect to the guest terminal?

Thanks
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Cannot Connect to Guest

Post by Ian »

When I was first setting mine up I also wanted to connect to it from the host but no amount of googling provided the answer. :cry:
I now use virt-manager and VNC to view the guests.

Maybe you could try killing that particular guest and making a fresh one using DHCP instead of a static ip address. Can't think of any other advice I'm afraid.

Sorry.

Ian.
expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Re: Cannot Connect to Guest

Post by expirobo »

Ok so I figured out what the problem is. If you're using bridged networking in your /etc/network/interfaces, you also need to use:
"--bridge br0 \"
in your vmbuilder script. That simply fixed it.

Also, to report back on why I can connect to the host on both 192.168.1.100 and 192.168.122.1. The second is a subnet used by virbr0 for dhcp setup. That's it. Shut that down and you're back to the setup explained in your site.

Thanks! This site has taken me through many hours of setup. I just setup my second media server using this site and except for my adventure with KVM, it went perfect.
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Cannot Connect to Guest

Post by Ian »

Thanks for the update.

I'm always keen to make sure my site is as accurate as it can be so can you clarify your point about the "--bridge br0 \" please. That argument is already present in the script. Are you saying you had to remove it to get it to work? It's possible the moving target that is Ubuntu has moved since I put together that particular page and/or you're using a version I've not tested it on.

Thanks for the info re the 2nd IP address. I'll have to check mine when I get home ;)

Glad you found the site useful (bar your kvm issue). Are you doing anything particularly exciting with your new server? What are you using your guests for? Sorry for being nosey but am always keen to hear what people do with theirs (gives me ideas for my own) :oops:

Ian.
expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Re: Cannot Connect to Guest

Post by expirobo »

I'm sorry, I just realized your script does have that in it. Maybe it was the order in which the attribute was passed. Nonetheless, here are my settings that are working on Ubuntu 11.10 Oneiric-Server:

VMBuilder:

Code: Select all

vmbuilder kvm ubuntu \
 --dest=/var/vm2 \
 --overwrite \
 --suite oneiric \
 --flavour virtual \
 --arch amd64 \
 --mem 512 \
 --rootsize 8192 \
 --swapsize 512 \
 --name 'Real Name' \
 --user usernamehere \
 --pass passwordhere \
 --hostname vm2 \
 --ip 192.168.1.102 \
 --mask 255.255.255.0 \
 --net 192.168.1.0 \
 --bcast 192.168.1.255 \
 --gw 192.168.1.1 \
 --addpkg openssh-server \
 --addpkg acpid \
 --addpkg nano \
 --components main,universe,restricted \
 --bridge br0 \
 --libvirt qemu:///system;
Here is my /etc/network/interfaces:

Code: Select all

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

#The Bridged Network
auto br0
iface br0 inet static
       #Address of HOST server
       address 192.168.1.100
       netmask 255.255.255.0
       network 192.168.1.0
       broadcast 192.168.1.255
       #Router IP
       gateway 192.168.1.1
       bridge_ports eth0
       bridge_fd 9
       bridge_hello 2
       bridge_maxage 12
       bridge_stp off
expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Re: Cannot Connect to Guest

Post by expirobo »

I am actually using this for fun. The main purpose of the new server (AMD x6 1100T 3.3 Ghz, 8 gig DDR1333, Zotac 890GX Mini-ITX) is to use it as a media server. I usually screw up software when messing around in Linux and have to reboot sometimes. Using a virtual machine to run my media server and a second to run a goofing around OS keeps me from having to do this. Who knows what I'll end up doing in the future.

Also, you may want to update your site to handle Mediatomb on the newer Linux releases. It is by default installed without 'libjs' support meaning you cannot us the import.js script. I'll do a write up on install libjs support and re-compiling mediatomb on Hardy-Oneiric later.
User avatar
Ian
Moderator
Posts: 752
Joined: January 1st, 2011, 7:00 am

Re: Cannot Connect to Guest

Post by Ian »

Sorry for the late reply. :oops:

Thanks for the heads up about MediaTomb. I stopped using MediaTomb so those pages have become very out of date. I should either remove it from the site or update it. Yet another task to add to my to-do list :roll:

Ian.
expirobo
Member
Member
Posts: 7
Joined: November 6th, 2011, 6:39 pm

Re: Cannot Connect to Guest

Post by expirobo »

Ian, what are you using now instead of Mediatomb?
Post Reply