|
Now that the system is up and running time to get Xen working. I realized that the xen kernel was not installed. Check the yum repository and no xen kerenl! A little more digging and I find out that Fedora Core 9 broke Xen and they are still working on getting it updated! Now here is one of linux's strong points. I need virtual machines, Planned on using Xen but there are 5 different ways to do it that I know of, including Xen, VMWare, Qemu, etc. So no Xen, I go ahead and pull down Qemu. It works with the hardware and with the kernel KVM module that allows the system to access the AMD-V functions. Just a quick yum install qemu and I was off and running!
The first thing to do was to shut down the GUI XWindows. This system does not have a monitor and all my access is across the network so no need for a windowing system. Start by vi'ing the /etc/inittab and changing the default init to 3. Also check the /etc/rc.d/rc3.d directory and make sure that the services I want start. On doing this I find that networking is turned off in init 3 so I move the K90network file to S90network so that it will have networking when it boots. Now type the command 'init 3' and put the system into the correct runlevel which disables xwindows and opens up some cpu and memory. From experience, installing virtual machines goes faster if the CD is an image on the Hard drive and it is not reading it from the CD-Rom drive. So Lets make an image of the FC-10 install media. Now we make a directory to store the DVD image, in this case it is /image. Then cd to the directory and type `cp /dev/dvd FC-10.iso` and hit enter. It is that easy to make an ISO of a CD or dvd in linux. when it is done we have a working ISO to use for the install of the Virtual Machine. While we are at it lets set up the bridging interface. Ill need it later down the line. First edit /etc/sysconfig/network-scripts/ifcfg-eth0 and make it look like this DEVICE=eth0 BOOTPROTO=none ONBOOT=yes TYPE=Ethernet USERCTL=no PEERDNS=yes IPV6INIT=no NM_CONTROLLED=no BRIDGE=br0 This will set the phisycal eth0 card to bridging. Now we create a file /etc/sysconfig/network-scripts/ifcfg-br0 and put in the network information for the connection. DEVICE=br0 TYPE=Bridge ONBOOT=yes IPADDR=192.168.1.107 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 Next we set the ifup and ifdown for qemu. These are the following files /etc/qemu-ifup and /etc/qemu-ifdown the qemu-ifup file has the following in it bridge=virbr0 ifconfig $1 0.0.0.0 up brctl addif $bridge $1 || true and the qemu-ifdown has the following bridge=virbr0 brctl delif $bridge $1 || true ifconfig $1 down these will greate the interfaces for the VM's as needed Lets get a new VM setup and installed. Start by SSH'ing to the host ssh -X -l root <vmhost name> The -X means it will display the gui across the network back to my desktop. Now I run linux as my desktop so everything works but if you are running windows it will require software to make that work. You may want to look at using Cygwin. now once Logged in type virt-manager It will load the gui virtual system manager  Now you will need to click on File then Connect and the system will give you the following window 
You will select the qemu Hypervisor and Connection should be local. Then click Connect. 
Now you have a clean virtual host ready so Time to install the virtual machines. Now we highlight the virtual host and the button at the bottom (New) will be avaliable to click. Once you click on that you will start the Virtual Host (VM) instillation. 
Now we move through the configuration filling in the needed information. 


Now earlier I suggested copying the dvd image into an iso named FC-10.iso located in the /images directory. Here is where you put it. Select browse and then go to the /images directory and select the isa as you iso image 
Now we set the drive image, I have created a directory called /KVM/images to store my actual VM drive images. So I select Simple File and put the location and file name. For the fun of it lets call this drive image Windows.img You can call the image anything you like. I also set the drive size (File Size) to 10 gigs so ill have enough space for everything.  Next we set up the network. There are two kinds of network connections for VM's Virtual Network and Shared Physical Device. The virtual Network is inside the machine and uses the Virtual hosts iptables to set up a NAT firewall for the VM's This is great if you are just setting up a system to take out onto the network but I am using them as servers so I need to have them on the local network with all the other systems. Earlyer I set up bridging so I select Shared Physical Device and set it to vnet0  Now Select the Memory and CPU's for the host, This is going to be a nagios server so 512m is more than enough for my small network. 
Virt-manager then shows you what you have set up, kind of a "Are you sure screen" Look it over and click finished. 
At this point it will run through some gyrations as it generates the file, formats it and gets everything set up. Then it will take you back to the virtual Machine Manager screen. As you can see I have a few systems started here
Go ahead and highlight the VM and select open, once the console is open you can click run and it will boot from the DVD image. From there it is a stock Fedora Core install
» Post Comment
» No Comments
There are no comments up to now.
|