March 20, 201412 yr Just incase anyone cares to know the steps to make a CentOS guest this is how I created mine. If anyone reads this and does a OMG why did you do x y or z don't hesitate to point it out. Step 1 download CentOS ISO. Easiest way is to just grab it on Unraid. I have a FILES share and just created a subfolder called linux for all my ISO's cd /mnt/user/FILES/linux wget http://mirror.symnds.com/CentOS/6.5/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso or any mirror from CentOS http://isoredirect.centos.org/centos/6/isos/x86_64/CentOS-6.5-x86_64-bin-DVD1.iso 2.) create folder and mount iso cd /mnt mkdir iso mount -o loop /mnt/user/FILES/linux/CentOS-6.5-x86_64-bin-DVD1.iso /mnt/iso 3.) create a configuration file for the new virtual guest, I used the same file structure as Ironicbadger used for the ArchVM tutorial /mnt/user/cache_only mkdir CentOS cd CentOS mcedit centos.cfg paste in the following name = "CentOS" #bootloader = "pygrub" kernel = "/mnt/iso/isolinux/vmlinuz" ramdisk = "/mnt/iso/isolinux/initrd.img" memory = 2048 vcpus = '2' disk = [ 'file:/mnt/user/FILES/linux/CentOS-6.5-x86_64-bin-DVD1.iso,hdc:cdrom,r', 'phy:/mnt/user/cache_only/CentOS/centos.img,xvda,w', ] vif = [ 'mac=00:16:3e:aa:bb:cc,bridge=br0' ] 4.) Create a img file for the disk, decide on the initial size of the disk for whatever purpose you are going to do this would make a 10GB disk truncate -s 10G centos.img 5.) install CentOS to the Guest xl create centos.cfg -c skip the disk check, for some reason it looses the disk now even though it says its found the local install media, just select reinitialize all and it carries on with no more issues. 6.) when the install is completed it will reboot, I ran a "xl destroy CentOS" to kill the session as the centos.cfg file will just keep rebooting with the DVD iso to reinstall once its stopped, re-edit the centos.cfg and change it to the following. name = "CentOS" bootloader = "pygrub" #kernel = "/mnt/iso/isolinux/vmlinuz" #ramdisk = "/mnt/iso/isolinux/initrd.img" memory = 2048 vcpus = '2' disk = [ # 'file:/mnt/user/FILES/linux/CentOS-6.5-x86_64-bin-DVD1.iso,hdc:cdrom,r', 'phy:/mnt/user/cache_only/CentOS/centos.img,xvda,w', ] vif = [ 'mac=00:16:3e:aa:bb:cc,bridge=br0' ] Then start it back up xl create centos.cfg -c you should boot straight into the console 7.) Configure CentOS for Networking change the hostname of the box vi /etc/sysconfig/network enable networking vi /etc/sysconfig/network-scripts/ifcfg-eth0 change the line that says ONBOOT=no to ONBOOT=yes Delete the line that says NM_CONTROLLED=yes and if required to change it to a static IP over DHCP Disable SELINUX ( THIS IS OPTIONAL ) vi /etc/sysconfig/selinux change SELINUX=enforcing to disabled or permissive Reboot the box at this point and reconnect to it xl console CentOS check you have network by running the following ifconfig you should see your eth0 with the ip address now do a update on the server to get it to the latest patch level yum update if you dont like vi and want nano or vim instead then run the following yum install nano yum install vim next install autofs yum install autofs point autofs to the Unraid box, these were cloned from how IronicBadgers autofs is set on Arch rm /etc/auto.master vi /etc/auto.master paste in the following /net -hosts --timeout=60 /media/Tower /etc/auto.Tower --timeout=0 nano /etc/auto.Tower paste in the following data -fstype=cifs,guest,rw ://Tower/data start up autofs service autofs start if this connects you and there are no issues run the following to make it autostart on reboots etc chkconfig autofs on You now have a basic CentOS guest to do with whatever you please.
March 20, 201412 yr Good writeup! Easier way to enable networking: sed -i 's|no|yes|' /etc/sysconfig/network-scripts/ifcfg-eth0 ifup eth0 disable Selinux: sed -i 's|enforcing|disabled|' /etc/sysconfig/selinux mine also wanted xenbr0 for the network bridge instead of br0 like in your writeup (think xenbr0 is default bridge naming?) Myk
March 31, 201412 yr Great guide! I am running into an issue after installation. I comment out the line that points to the installer and when I load centos again it keeps going into the installer. I have even deleted the line in the .cfg file and it still loads into the installer. I'm wondering if I did something wrong during the initial installation?
March 31, 201412 yr make sure to edit your .cfg name = "CentOS" bootloader = "pygrub" #kernel = "/mnt/iso/isolinux/vmlinuz" #ramdisk = "/mnt/iso/isolinux/initrd.img" memory = 2048 vcpus = '2' disk = [ # 'file:/mnt/user/FILES/linux/CentOS-6.5-x86_64-bin-DVD1.iso,hdc:cdrom,r', 'phy:/mnt/user/cache_only/CentOS/centos.img,xvda,w', ] vif = [ 'mac=00:16:3e:aa:bb:cc,bridge=br0' ] Did you miss the bootloader line? Myk
Archived
This topic is now archived and is closed to further replies.