LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to do virtualization on CentOS? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-do-virtualization-on-centos-4175472799/)

Altiris 08-09-2013 01:29 PM

How to do virtualization on CentOS?
 
I have a CentOS 6.4 computer and I want to run a multiplayer server on it however it does not work with Wine. I want to do virtualization on the Centos PC so it can run windows 7 or another type of windows and then so I can run the server in there.

What programs do I need? I do want a Client/UI.

acid_kewpie 08-09-2013 01:57 PM

You have all the virtualization tools you need already there for you, as long as you're running on a 64bit platform using KVM. plenty of hits out there... https://www.google.co.uk/search?q=centos+virtualization this is a good start - http://www.linuxtopia.org/online_boo...irtualization/

essentially you can probably just fire up virt-manager and pretty much just start straight away.

Satyaveer Arya 08-09-2013 02:01 PM

Get this guide and try:
http://www.centos.org/docs/5/pdf/Virtualization.pdf

Altiris 08-09-2013 02:05 PM

Whoa thanks for all of this guys. I will try! Wait a minute, does Windows XP support virtualization, no right?

Altiris 08-09-2013 06:18 PM

I am confused, do I follow the guides from CentOS or the one from RHEL? Also, what is better KVM or Xen. I read that Xen requires something in the kernel and also a hypervisor. I just want a simple virtual machine running Windows XP to run a server for a game (it's a small server). I'm not doing anything too important.

chrism01 08-09-2013 09:17 PM

Centos is a free rebuild of RHEL, so they are essentially the same.
KVM is the 'newer' VM mgr than Xen, and RHEL (& Centos) dropped Xen at v5 ie you can get xen or KVM on (later versions) RHEL 5, KVM only on RHEL/Centos 6.x (recommended and 64 bit if possible).
Do read the links provided and possibly ask the Mods (via the Report button) to move this to the Virt & Cloud forum.

Altiris 08-09-2013 11:23 PM

I know CentOS aims to be 100% binary compatible and stuff but sometimes there are some features such as the Apache GUI or something that's RHEL only that's why I was asking. There are so many different guides I've read all of them but which should I follow?

acid_kewpie 08-10-2013 02:55 PM

The sooner you stop caring about gui's the better. If any service is rated principally by being pretty and clicky, you're going to have a bad time.

dt64 08-11-2013 12:42 PM

All GUIs you may need are available in CentOS as well as in RHEL. The only main difference between RHEL and CentOS is that CentOS doesn't come with the copyrighted RH things like names, pics, icons...
Start using http://wiki.centos.org/HowTos/KVM (it's for v5.x but works exactly same way in v6.x). If you absolutely need a GUI you may try webmin (I've tried it but am back to console only...).
Virt-manager is a nice GUI for the virtualization things and is you have seen e.g. Vmware workstation/player you might love it.

Altiris 08-12-2013 05:15 PM

Alright guys I need some help, I followed this guide one of you suggested http://www.howtoforge.com/virtualiza...tos-6.4-server everything went successfully until I am at the part where it says that I have to make a bridge. (Use ctrl F to search and type "configure a bridge".

I installed bridge-utils like it said (actually centos said it was already installed and is latest version). I also followed the setps of making a br0 text file in "/etc/sysconfig/network-scripts/". When I restart the network daemon the console gives me this FAILING error

Code:

Shutting down interface eth0:  Error: Device 'eth0' (/org/freedesktop/NetworkManager/Devices/0) disconnecting failed: This device is not active
                                                          [FAILED]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:  Active connection state: activating
Active connection path: /org/freedesktop/NetworkManager/ActiveConnection/13
state: activated
Connection activated
                                                          [  OK  ]
Bringing up interface br0:  Error: Connection activation failed: Failed to determine connection's virtual interface name
                                                          [FAILED]

This is my eth0 config
Code:

DEVICE="eth0"
BOOTPROTO=none
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
NM_CONTROLLED="yes"
ONBOOT="yes"
TYPE="Ethernet"
UUID="fa8c06c7-bd10-4ba1-b89c-a7699deae740"
HWADDR= I PUT THIS BLANK ONLY TO POST FOR SECURITY
IPADDR=192.168.12.137
PREFIX=24
GATEWAY=192.168.12.12
DNS1=127.0.0.1
DNS2=75.75.75.75
DOMAIN="dataglobe.com"
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME="System eth0"
LAST_CONNECT=1373901339
BRIDGE="br0"

This is my br0 config
Code:

DEVICE="br0"
NM_CONTROLLED="yes"
ONBOOT=yes
TYPE=Bridge
BOOTPROTO=none
IPADDR=192.168.12.137
PREFIX=24
GATEWAY=192.168.0.1
DNS1=75.75.75.75
DNS2=75.75.76.76
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=no
NAME="System br0"


dt64 08-13-2013 04:50 AM

try it simpler:

for /etc/sysconfig/network-scripts/ifcfg-br0:
Code:

DEVICE=br0
BOOTPROTO=none
ONBOOT=yes
DELAY=0
TYPE=Bridge
IP_ADDR=192.168.12.137
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=75.75.75.75
DNS2=75.75.76.76

for /etc/sysconfig/network-scripts/ifcfg-eth0:
Code:

NM_CONTROLLED="no"
ONBOOT=yes
HWADDR=B2:B5:3F:f5:D3:23
BRIDGE=br0

The key thing here is that eth0 does not get a IP addresses assigned to itself.
You may make it even more complex if you add e.g. a bond including eth0 and eth1 and assign this to the bridge.

scottro11 08-13-2013 07:04 AM

A very good and quick guide for virtualization with KVM on CentOS/RedHat is at

http://linux.dell.com/files/whitepap..._made_easy.pdf

KVM is great when used for servers without a GUI. I've not had great experience using it to run GUIs, whether Windows or even a light Linux distribution. For that, VirtualBox or VMware-player do a better job for me. Both are also free.

KVM though (just an impression, I have no benchmarks) seems to use fewer resources than the other two.

Altiris 08-13-2013 12:48 PM

Quote:

Originally Posted by dt64 (Post 5008380)
try it simpler:

for /etc/sysconfig/network-scripts/ifcfg-br0:
Code:

DEVICE=br0
BOOTPROTO=none
ONBOOT=yes
DELAY=0
TYPE=Bridge
IP_ADDR=192.168.12.137
NETMASK=255.255.255.0
GATEWAY=192.168.0.1
DNS1=75.75.75.75
DNS2=75.75.76.76

for /etc/sysconfig/network-scripts/ifcfg-eth0:
Code:

NM_CONTROLLED="no"
ONBOOT=yes
HWADDR=B2:B5:3F:f5:D3:23
BRIDGE=br0

The key thing here is that eth0 does not get a IP addresses assigned to itself.
You may make it even more complex if you add e.g. a bond including eth0 and eth1 and assign this to the bridge.

Hold on, I need eth0 to have a local static IP otherwise my FTP server, game servers, DNS etc. wont work. Or do I not assign eth0 a static because br0 will have it and then it will be bridged? In the guide both br0 and eth0 have an IP address assigned in their files. (I am confused).

I had a question about this, whether or not the br0 gets the same or different IP address as eth0 but you stated not to put any IP address for eth0, so that resolves the question I assume?

dt64 08-13-2013 07:33 PM

Quote:

Originally Posted by Altiris (Post 5008655)
Hold on, I need eth0 to have a local static IP otherwise my FTP server, game servers, DNS etc. wont work. Or do I not assign eth0 a static because br0 will have it and then it will be bridged? In the guide both br0 and eth0 have an IP address assigned in their files. (I am confused).

I had a question about this, whether or not the br0 gets the same or different IP address as eth0 but you stated not to put any IP address for eth0, so that resolves the question I assume?

That's correct. Eth0 doesn't get a IP, in this config all traffic goes via br0, even your FTP server etc.

Altiris 08-14-2013 07:08 PM

Ive discovered a problem, whenever I add BRIDGE=eth0 to the eth0 config file thats when everything or eth0 stops working. I tried it your way and my way (my way meaning I kept my default eth0 config but used your br0 config) and everything works, this is with leaving everything in the eth0 commented in the eth0 file. If I start commenting things out of the eth0 such as IP address etc then eth0 stps working which is normal because I havent bridged eth0 and br0. So basically, the problem is the BRIDGE=br0 command, whenever I do that everything gets messed up. I tried reinstalling the bridge-utils package and restarting my PC but I get the same problem. Any help?

Thanks for your help so far, the br0 config made it br0 work at least and show up in ifconfig.


All times are GMT -5. The time now is 05:19 AM.