Can somebody point me to a HowTO or other documentation describing the tools available under the CentOS 5 KVM package to create and manage a Windows 7 Pro VM? All my VM experience to date has been the old free VMware Server.
I need to: + Create the VM instance allowing for about 50GB total disk space which will be either a single image partitioned into two Windows 'Drives' for the OS and applications/data, or two images.
+ Install Windows 7 from an OEM System Builder Pack, either using the CD/DVD drive on the Linux server or from an image created with 'dd' from the Win7 media.
+ Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
Thanks
Bill
On Thu, Aug 16, 2012 at 3:04 AM, Bill Campbell centos@celestial.com wrote:
Can somebody point me to a HowTO or other documentation describing the tools available under the CentOS 5 KVM package to create and manage a Windows 7 Pro VM? All my VM experience to date has been the old free VMware Server.
Assuming you have hardware acceleration and 64 bit version installed, look for the virt-manager package.
The interface is very similar to virtual box.
I need to:
- Create the VM instance allowing for about 50GB total disk space which will be either a single image partitioned into two Windows 'Drives' for the OS and applications/data, or two images.
The default location for the hard disk image file is under /var/lib path. This can be changed to point to a different location if you are planning many such large installation. An alternate method could be to define a file or a LVM and then tell virt-manager the location of this file/LVM volume.
- Install Windows 7 from an OEM System Builder Pack, either using the CD/DVD drive on the Linux server or from an image created with 'dd' from the Win7 media.
Any x86 OS can be installed. Choose a NIC like Realtek or Intel Pro, drivers for which should be recognizable by the Windows installer.
- Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
I have done KVM VLANs but I am not sure if it can be done from the virt-manager. Experiment and see how far you can go.
Best,
On Thu, Aug 16, 2012 at 7:11 PM, Arun Khan knura9@gmail.com wrote:
On Thu, Aug 16, 2012 at 3:04 AM, Bill Campbell centos@celestial.com wrote:
- Install Windows 7 from an OEM System Builder Pack, either using the CD/DVD drive on the Linux server or from an image created with 'dd' from the Win7 media.
Any x86 OS can be installed.
+1
IIRC, according to: http://wiki.qemu.org/download/qemu-doc.html
about 25 CPU architechtures are supported by qemu which is usually included in distributions. x86 is just one of them.
On Thu, Aug 16, 2012, Arun Khan wrote:
On Thu, Aug 16, 2012 at 3:04 AM, Bill Campbell centos@celestial.com wrote:
Can somebody point me to a HowTO or other documentation describing the tools available under the CentOS 5 KVM package to create and manage a Windows 7 Pro VM? All my VM experience to date has been the old free VMware Server.
Assuming you have hardware acceleration and 64 bit version installed, look for the virt-manager package.
Thanks. I found that after doing some poking around. I'll be in my normal 'learn by destroying' mode this afternoon (apologies to Jeff Lieberman of learnbydestroying.com :-).
The interface is very similar to virtual box.
I've never used that, only VMware so far.
I need to:
- Create the VM instance allowing for about 50GB total disk space which will be either a single image partitioned into two Windows 'Drives' for the OS and applications/data, or two images.
The default location for the hard disk image file is under /var/lib path. This can be changed to point to a different location if you are planning many such large installation. An alternate method could be to define a file or a LVM and then tell virt-manager the location of this file/LVM volume.
Thanks for that info. It looks like everything is under /var/lib/libvrt.
I assume that I can replace /var/lib/libvirt/images with a symlink to another file system with adequate space.
Would it be safe to symlink the entire /var/lib/libvrt directory to another file system? I just tried 'lsof /var/lib/libvirt' on the system with no VMs and the libvrtd service running, and it doesn't show anything using it at idle.
- Install Windows 7 from an OEM System Builder Pack, either using the CD/DVD drive on the Linux server or from an image created with 'dd' from the Win7 media.
Any x86 OS can be installed. Choose a NIC like Realtek or Intel Pro, drivers for which should be recognizable by the Windows installer.
- Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
I have done KVM VLANs but I am not sure if it can be done from the virt-manager. Experiment and see how far you can go.
I will be digging into this later today. So far I've found the file /var/lib/libvirt/network/default.xml and see a vibr0 interface defined.
The documentation I found yesterday described setting up briding, but hopefully virt-manager has a nicer way to do it.
Bill
Digimer's tutorial is excellent, even your particular usage case covers only partial aspects of what is described here or you're not doing clusters.
On 08/16/2012 06:36 PM, Bill Campbell wrote:
I need to: + Create the VM instance allowing for about 50GB total disk space which will be either a single image partitioned into two Windows 'Drives' for the OS and applications/data, or two images.
The default location for the hard disk image file is under /var/lib path. This can be changed to point to a different location if you are planning many such large installation. An alternate method could be to define a file or a LVM and then tell virt-manager the location of this file/LVM volume.
Thanks for that info. It looks like everything is under /var/lib/libvrt.
I assume that I can replace /var/lib/libvirt/images with a symlink to another file system with adequate space.
Would it be safe to symlink the entire /var/lib/libvrt directory to another file system? I just tried 'lsof /var/lib/libvirt' on the system with no VMs and the libvrtd service running, and it doesn't show anything using it at idle.
Yes, as long as SeLinux is not enforced. But why not simply mount a dedicated partition here? The actual path is stored in de VM definition. So existing machines need to be changed (virsh edit <VM>). I think the default path is only used as e default location. I have moved the images of several machines to a NFS path to make live migration work. Do remember that /var/lib/libvirt/qemu/save is used to save system state when rebooting. Still needs several GB of space for that.
+ Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
I have done KVM VLANs but I am not sure if it can be done from the virt-manager. Experiment and see how far you can go.
I will be digging into this later today. So far I've found the file /var/lib/libvirt/network/default.xml and see a vibr0 interface defined.
The documentation I found yesterday described setting up briding, but hopefully virt-manager has a nicer way to do it.
This I find the most difficult part. I have done it a couple of time and made myself a HOWTO. You need to fill in some IP figures of course. I assume a fixed IP address, but DHCP should work as well. The setup creates a bridge and adds and existing interface (ifcfg-ethx) to that bridge. After that you can use the bridge for the VMs:
KVM === yum install kvm virt-manager qemu bridge-utils #create bridge for virt-machine cat > /etc/sysconfig/network-scripts/ifcfg-br0 << _END_ DEVICE=br0 TYPE=Bridge IPADDR=192.168.48.X NETMASK=255.255.255.0 GATEWAY=192.168.48.1 BOOTPROTO=none ONBOOT=yes DELAY=0 NOZEROCONF=true NM_CONTROLLED=no _END_
Edit /etc/sysconfig/network-scripts/ifcfg-ethx : ONBOOT=yes BRIDGE=br0 NM_CONTROLLED=no
service network restart
On Thu, Aug 16, 2012, Theo Band wrote:
On 08/16/2012 06:36 PM, Bill Campbell wrote:
...
+ Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
I have done KVM VLANs but I am not sure if it can be done from the virt-manager. Experiment and see how far you can go.
I will be digging into this later today. So far I've found the file /var/lib/libvirt/network/default.xml and see a vibr0 interface defined.
The documentation I found yesterday described setting up briding, but hopefully virt-manager has a nicer way to do it.
This I find the most difficult part. I have done it a couple of time and made myself a HOWTO. You need to fill in some IP figures of course. I assume a fixed IP address, but DHCP should work as well. The setup creates a bridge and adds and existing interface (ifcfg-ethx) to that bridge. After that you can use the bridge for the VMs:
I got things installed yesterday, adding a routed network section using virt-manager linked to the private interface, eth1. I left the default NAT interface as-is.
After rebooting the machine, two bridge devices, virbr0 and virbr1 appear in 'ifconfig' output with the appropriate IP addresses (192.168.122.1 and 192.168.100.1 respectively).
The 'route -n' command shows reasonable routes for the VMs.
I am thoroughly confused by the documentation I've found so far, much of which seems to be out of date.
When the Windows VM is active with the network virbr1 defined with virt-manager and all other things default, a 'vmnet0' device appears in 'ifconfig' output. I can ping the IPs on the private lan (192.168.101.0/24 in this case), but cannot get to the outside world, nor can hosts on the LAN ping the VM's assigned IP address 192.168.100.114.
If I shut down the VM, manually run 'brctl addif virbr1 eth1', then start the VM things change:
+ The IP address assigned to the VM is in the 192.168.101.0/24 block instead of 192.168.100.0/24 defined in virt-manager.
+ I can ping the outside world from the VM.
+ I can ping other hosts in 192.168.101.0/24, but *NOT* the Linux boxes IP address.
+ I cannot ping anything in 192.168.101.0/24 from the command line on the Linux host (logged in with ssh on the public interface).
+ The command 'brctl show' displays vmnet0 and eth1 vir virbr1.
I'm more than a bit confused at this point.
My main goal is to get LAN and OpenVPN access to the Windows VM. I really don't care about Internet access from the Windows VM, although Microsoft really wants it to get updates and such.
KVM
yum install kvm virt-manager qemu bridge-utils #create bridge for virt-machine cat > /etc/sysconfig/network-scripts/ifcfg-br0 << _END_ DEVICE=br0 TYPE=Bridge IPADDR=192.168.48.X NETMASK=255.255.255.0 GATEWAY=192.168.48.1 BOOTPROTO=none ONBOOT=yes DELAY=0 NOZEROCONF=true NM_CONTROLLED=no _END_
Edit /etc/sysconfig/network-scripts/ifcfg-ethx : ONBOOT=yes BRIDGE=br0 NM_CONTROLLED=no
service network restart _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Am 18.08.2012 00:06, schrieb Bill Campbell:
On Thu, Aug 16, 2012, Theo Band wrote:
On 08/16/2012 06:36 PM, Bill Campbell wrote:
...
+ Set up network bridging on the private LAN so that the Windows system is accessible via OpenVPN connections from the outside world and by users on the LAN to run a client/server accounting application.
I have done KVM VLANs but I am not sure if it can be done from the virt-manager. Experiment and see how far you can go.
I will be digging into this later today. So far I've found the file /var/lib/libvirt/network/default.xml and see a vibr0 interface defined.
The documentation I found yesterday described setting up briding, but hopefully virt-manager has a nicer way to do it.
This I find the most difficult part. I have done it a couple of time and made myself a HOWTO. You need to fill in some IP figures of course. I assume a fixed IP address, but DHCP should work as well. The setup creates a bridge and adds and existing interface (ifcfg-ethx) to that bridge. After that you can use the bridge for the VMs:
I got things installed yesterday, adding a routed network section using virt-manager linked to the private interface, eth1. I left the default NAT interface as-is.
After rebooting the machine, two bridge devices, virbr0 and virbr1 appear in 'ifconfig' output with the appropriate IP addresses (192.168.122.1 and 192.168.100.1 respectively).
The 'route -n' command shows reasonable routes for the VMs.
I am thoroughly confused by the documentation I've found so far, much of which seems to be out of date.
When the Windows VM is active with the network virbr1 defined with virt-manager and all other things default, a 'vmnet0' device appears in 'ifconfig' output. I can ping the IPs on the private lan (192.168.101.0/24 in this case), but cannot get to the outside world, nor can hosts on the LAN ping the VM's assigned IP address 192.168.100.114.
If I shut down the VM, manually run 'brctl addif virbr1 eth1', then start the VM things change:
+ The IP address assigned to the VM is in the 192.168.101.0/24 block instead of 192.168.100.0/24 defined in virt-manager. + I can ping the outside world from the VM. + I can ping other hosts in 192.168.101.0/24, but *NOT* the Linux boxes IP address. + I cannot ping anything in 192.168.101.0/24 from the command line on the Linux host (logged in with ssh on the public interface). + The command 'brctl show' displays vmnet0 and eth1 vir virbr1.
I'm more than a bit confused at this point.
My main goal is to get LAN and OpenVPN access to the Windows VM. I really don't care about Internet access from the Windows VM, although Microsoft really wants it to get updates and such.
KVM
yum install kvm virt-manager qemu bridge-utils #create bridge for virt-machine cat > /etc/sysconfig/network-scripts/ifcfg-br0 << _END_ DEVICE=br0 TYPE=Bridge IPADDR=192.168.48.X NETMASK=255.255.255.0 GATEWAY=192.168.48.1 BOOTPROTO=none ONBOOT=yes DELAY=0 NOZEROCONF=true NM_CONTROLLED=no _END_
Edit /etc/sysconfig/network-scripts/ifcfg-ethx : ONBOOT=yes BRIDGE=br0 NM_CONTROLLED=no
service network restart _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
I am not sure about your issue, but here is how i make my bridges: http://www.darktemple.ch/wiki/doku.php?id=linux:kvm#network_bridging
I hope that helps.
On 08/18/2012 04:43 AM, skull wrote:
I am not sure about your issue, but here is how i make my bridges: http://www.darktemple.ch/wiki/doku.php?id=linux:kvm#network_bridging
That seems far more complicated than the vendor's documentation. Is there a reason that you use that method?
On 08/18/2012 12:06 AM, Bill Campbell wrote:
I got things installed yesterday, adding a routed network section using virt-manager linked to the private interface, eth1. I left the default NAT interface as-is.
After rebooting the machine, two bridge devices, virbr0 and virbr1 appear in 'ifconfig' output with the appropriate IP addresses (192.168.122.1 and 192.168.100.1 respectively).
The 'route -n' command shows reasonable routes for the VMs.
I am thoroughly confused by the documentation I've found so far, much of which seems to be out of date.
When the Windows VM is active with the network virbr1 defined with virt-manager and all other things default, a 'vmnet0' device appears in 'ifconfig' output. I can ping the IPs on the private lan (192.168.101.0/24 in this case), but cannot get to the outside world, nor can hosts on the LAN ping the VM's assigned IP address 192.168.100.114.
If I shut down the VM, manually run 'brctl addif virbr1 eth1', then start the VM things change:
+ The IP address assigned to the VM is in the 192.168.101.0/24 block instead of 192.168.100.0/24 defined in virt-manager. + I can ping the outside world from the VM. + I can ping other hosts in 192.168.101.0/24, but*NOT* the Linux boxes IP address. + I cannot ping anything in 192.168.101.0/24 from the command line on the Linux host (logged in with ssh on the public interface). + The command 'brctl show' displays vmnet0 and eth1 vir virbr1.
I'm more than a bit confused at this point.
My main goal is to get LAN and OpenVPN access to the Windows VM. I really don't care about Internet access from the Windows VM, although Microsoft really wants it to get updates and such.
Do you have iptables enabled? If so add a rule for the bridge as well.
On 08/18/2012 02:57 PM, Theo Band wrote:
Do you have iptables enabled? If so add a rule for the bridge as well.
Red Hat's documentation covers that. Administrators have two options. They can add an iptables rule that allows traffic, or they can configure the bridged traffic to not pass through iptables. The latter should use fewer CPU cycles, improving guest performance.
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/5/ht...
On 08/17/2012 03:06 PM, Bill Campbell wrote:
I got things installed yesterday, adding a routed network section using virt-manager linked to the private interface, eth1. I left the default NAT interface as-is.
That won't do what you want. If you want other machines on the LAN to be able to reach your guest, then you MUST configure bridged networking:
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/5/ht...
On 08/16/2012 09:36 AM, Bill Campbell wrote:
I assume that I can replace /var/lib/libvirt/images with a symlink to another file system with adequate space.
Would it be safe to symlink the entire /var/lib/libvrt directory to another file system?
As has been pointed out, SELinux may prevent that from working with a simple symlink. You have two options that will work:
1: Create a symlink and set the context of the link destination to the same context used for /var/lib/libvirt/images. Use semanage to make the changes permanent, or else a restorecon might break the system: http://docs.fedoraproject.org/en-US/Fedora/13/html/Security-Enhanced_Linux/s...
2: Use a "bind" mount instead of a symlink. Enter a line in /etc/fstab like this one: /bigger/fs /var/lib/libvirt/images none bind 0 0 Then, mount /var/lib/libvirt/images and "restorecon -r -v /var/lib/libvirt/images"
On 08/16/2012 12:34 AM, Bill Campbell wrote:
Can somebody point me to a HowTO or other documentation describing the tools available under the CentOS 5 KVM package to create and manage a Windows 7 Pro VM? All my VM experience to date has been the old free VMware Server.
Just for information, there is a "centos-virt" ML.
My VM configuration dumps are here: https://code.google.com/p/rktmb-samples/source/browse/trunk/xml-vmconfig you'll find some comparison point to what you get. My VMs are all routed+NATed (for those). I dont have bridged Windows.
This is my sample invocation when installing a Windows:
sudo virt-install --connect qemu:///system --name win-7-01 \ --ram 1024 --keymap=fr \ --cdrom=/media/500G/ISO/Windows7Ultimate64bit.iso \ --os-type=windows \ --os-variant=win7 --network=network:default --vnc --accelerate \ --force --disk path=/mnt/big/mihamina/Virtual/win-7-01,size=20
On Sat, Aug 18, 2012, Mihamina Rakotomandimby wrote:
On 08/16/2012 12:34 AM, Bill Campbell wrote:
Can somebody point me to a HowTO or other documentation describing the tools available under the CentOS 5 KVM package to create and manage a Windows 7 Pro VM? All my VM experience to date has been the old free VMware Server.
Just for information, there is a "centos-virt" ML.
Thanks for that hint. I subscribed a couple of days ago, but so far haven't seen any traffic. A google search of the archives did turn up some interesting posts.
I have things working now after cleaning up some of the cruft left around after my original attempts to follow the docs. <standard input>:17: warning [p 1, 1.7i]: can't break line
1. Create a bridge, 'br0' following the writeup on this page (and several others):
https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/5/ht...
This link also has some interesting hints.
http://itscblog.tamu.edu/startup-guide-for-kvm-on-centos-6/
2. Delete the routed network definition I had made prior to creating the bridge. Things didn't work properly with the old definition even though it was point to my private interface, 'eth1'. I also deleted the 'default' NAT interface as we will never use that.
3. Check for other software that references the new bridge, changing the old 'eth1' interface to 'br0'. Samba shares were not appearing until I updated 'interfaces' in the 'smb.conf' file. This may have been caused when I turned sharing on in the Win7 VM which I didn't need.
Bill