Virtualization With KVM On A CentOS 6.4 Server - Page 2

5 Connecting To The Guest

Fedora 17 Desktop:

The KVM guest will now boot from the Debian Squeeze Netinstall CD and start the Debian installer - that's why we need to connect to the graphical console of the guest. You can do this with virt-manager on the Fedora 17 desktop.

Go to Applications > System Tools > Virtual Machine Manager to start virt-manager:

Type in your password:

When you start virt-manager for the first time, you will most likely see the message Unable to open a connection to the libvirt management daemon. You can ignore this because we don't want to connect to the local libvirt daemon, but to the one on our CentOS 6.4 KVM host. Click on Close and go to File > Add Connection... to connect to our CentOS 6.4 KVM host:

Select QEMU/KVM as Hypervisor, then check Connect to remote host, select SSH in the Method drop-down menu, type in root as the Username and the hostname (server1.example.com) or IP address (192.168.0.100) of the CentOS 6.4 KVM host in the Hostname field. Then click on Connect:

If this is the first connection to the remote KVM server, you must type in yes and click on OK:

Afterwards type in the root password of the CentOS 6.4 KVM host:

You should see vm10 as running. Mark that guest and click on the Open button to open the graphical console of the guest:

Type in the root password of the KVM host again:

You should now be connected to the graphical console of the guest and see the Debian installer:

Now install Debian as you would normally do on a physical system. Please note that at the end of the installation, the Debian guest needs a reboot. The guest will then stop, so you need to start it again, either with virt-manager or like this on our CentOS 6.4 KVM host command line:

CentOS 6.4 KVM Host:

virsh --connect qemu:///system

start vm10

quit

Afterwards, you can connect to the guest again with virt-manager and configure the guest. If you install OpenSSH (package openssh-server) in the guest, you can connect to it with an SSH client (such as PuTTY).

Share this page:

9 Comment(s)

Add comment

Comments

From: Timothy K at: 2013-06-07 13:21:30

 I had SELinux disabled on my CentOS 6.4 system. I didn't test with SELinux on; it might work, but if not, you better switch off SELinux as well:

 This is poor advice.  If you are running KVM chances are you are also going to be running a webserver of some kind, likely connected to a public network in some way.  In this setting you don't want your processes running unconstrained on the system.

 Instead of disabling SELinux entirely - set it to 'Permissive'.  This won't enforce any policies.  It will however log any process that violates the policies, so you can refer to it later and adjust your settings as necessary.

From: V.J. at: 2013-07-11 21:06:11

I have followed the instructions upto starting the network service.

when I run /etc/init.d/network restart I get the following error:

 

Shutting down interface eth0:  Device state: 3 (disconnected)
                                                           [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Error: Connection activation failed: Master connection not found or invalid
                                                           [FAILED]
Bringing up interface br0:  Error: Connection activation failed: Failed to determine connection's virtual interface name
                                                           [FAILED]
 

From: Anonymous at: 2013-08-16 21:48:15

I usually just set NM_CONTROLLED=NO and then do a 'service network restart'.

From: Shashank at: 2014-01-13 20:33:25

I faced the same problem but now I got the solution. 

When changing the config of eth0 interface, leave it as is instead of commenting ipaddr, gateway etc etc. 

From: httpstergeek at: 2013-11-11 16:34:47

I experienced the same problem.  Where you able to resolve it?

From: RjBradlow at: 2013-11-16 06:18:33

Red Hat Enterprise Linux ~ Virtualization Guide

10.2. Bridged networking with libvirt

Bridged networking (also known as physical device sharing) is used for dedicating a physical device to a virtual machine. Bridging is often used for more advanced setups and on servers with multiple network interfaces.

Disable Xen network scripts

If your system was using a Xen bridge, it is recommended to disable the default Xen network bridge by editing /etc/xen/xend-config.sxp and changing the line:

(network-script network-bridge)

To:

(network-script /bin/true)

 

Disable NetworkManager

NetworkManager does not support bridging. Running NetworkManager will overwrite any manual bridge configuration. Because of this, NetworkManager should be disabled in order to use networking via the network scripts (located in the /etc/sysconfig/network-scripts/ directory):

# chkconfig NetworkManager off

# chkconfig network on

# service NetworkManager stop

# service network start

Note

As an alternative to turning off NetworkManager, add "NM_CONTROLLED=no" to the ifcfg-* scripts used in the examples.

If you do not either set this parameter or disable NetworkManager entirely, any bridge configuration will be overwritten and lost when NetworkManager next starts.

...

From: Anonymous at: 2014-07-24 02:20:28

Thanks for the tip. I received the "Master connection not found or invalid" error when starting etho0 and br0. After setting NM_CONTROLLED=no in both the eth0 and br0 config files, that error was fixed.

From: at: 2014-06-15 20:15:41

A lot thanks for this kind of documents share clearly. Its never easy for me to install centOS KVM as a beginners. This post really helped me a lot. :)

From: gabrielsaragoca at: 2015-02-10 01:38:11

Is the new version of Update Rollup 4 for virtual machine management 2012 R2 released yet? (pulled back in late October).