The main product of the Israel based company is KVM (the Kernel-based Virtual Machine).
Ever since February 2007 KVM is part of the Linux kernel (2.6.20+).
Here a good reference on kvm:
http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5/html/Virtualization_Guide/
Howto install KVM on Fedora 13:
Official Red Hat support
sudo yum install virt-manager
sudo yum install libvirt
sudo yum install kvm
or
sudo yum groupinstall 'Virtualization'
Often you come from another virtualization envioronement (VMware or Virturalbox)
Check if you can start a virtual daemon
$ sudo service libvirtd start
error : qemudListenUnix:570 : Failed to bind socket to '@/home/jboss-as/.libvirt/libvirt-sock': Address already in use
This error occurs b/c another virutalization enviroment is blocking you
Run KVM
Either by GUI Alt + F2 or directly on command line 'virt-manager'
Image source |
Run KVM
Either by GUI Alt + F2 or directly on command line 'virt-manager'
Start screen:
Then choose 'Edit' -- 'Host details'
By default KVM stores the virtual machines within /var/lib/libvirt/images/*.img, if you want to change that goto the 'Storage' tab and choose the plus sign (Add pool). Choose the file system type 'dir' to store future virtual machines on your hard drive.
The solution
Another elegant solution is that you leave the defaults and you create a soft link on your machine
- VM - Image file can be found in directory /var/lib/libvirt/images/*.img
sudo rm -rf /var/lib/libvirt/images
sudo ln -s /data/virtual_machines /var/lib/libvirt/images - VM - Description file can be found in /etc/libvirt/qemu/*.xml
sudo cp -r /etc/libvirt/qemu /tmp/virtual_machines/qemu (first back it up)
sudo rm -rf /etc/libvirt/qemusudo ln -s /data/virtual_machines/qemu /etc/libvirt/qemu├── jon.xml
├── jon.log├── network│ ├── autostart│ │ ├── default.xml -> /etc/libvirt/qemu/networks/default.xml│ │ └── prive.xml -> /etc/libvirt/qemu/networks/prive.xml│ ├── default.xml│ └── prive.xml
avec
-rw------- 1 qemu qemu 4GB jon.img
- VM - Network file can be found in /var/lib/libvirt/network/default.xml
sudo cp -r /var/lib/libvirt/network /tmp/virtual_machines/network
sudo rm -rf /var/lib/libvirt/network
sudo ln -s /data/virtual_machines/network /var/lib/libvirt/network - VM - Logging file can be found in /var/log/libvirt/qemu/*.log
sudo rm -rf /var/log/libvirt/qemu/
ln -s /data/virtual_machines /var/log/libvirt/qemu - Move tmp folder
mkdir /data/virtual_machines
sudo cp -r /tmp/virtual_machines/* /data/virtual_machines
sudo rm -rf /tmp/virtual_machines
sudo cp /vm_backup/jon.xml /data/virtual_machines/jon.xml
sudo cp /vm_backup/jon.img /data/virtual_machines/jon.img
# check if your IP in prive.xml is correctly set 192.168.100. and change virbr0 to vm-kvm for example
sudo cp /data/virtual_machines3/networks/prive.xml /data/virtual_machines/qemu/networks/prive.xml
sudo cp /data/virtual_machines3/networks/prive.xml /data/virtual_machines/network/prive.xml
sudo ln -s ../prive.xml /data/virtual_machines/qemu/networks/prive.xml
chown qemu:qemu /data/virtual_machines/* - Restart libvirt
service libvirtd restart
Add virtual machine
- Click first icon in toolbar "Create a new virtual machine"
- Choose name 2010_FED13_64_OracleDB10g
Install your operating system
If you have chosen Fedora 13 (for example) do not be scared of the messeges that tell you
"REINITIALIZING WILL CAUSE ALL DATA TO BE LOST"
It is only the data within the virtual machine file that was created. The scary message is subject of discussion of redhat support.
Starting Virtual machine
After having installed your OS (up to 3 hours) you'll have to restart your computer.
I ran into a freezed screen saying 'Booting from Hard Disk...' (here the Red Hat discussion)
add this '-enable-kvm'
At the beginning of the startup process you can hit Ctrl+B to enter the command line of the prebootloader gPXE.
Follow-up: The problem was having hardware virtualization support turned off in the host's BIOS. (Doh!) Once I turned that on, not only was installing a guest about 10x faster, but it also booted properly afterward.
> Hi, > > I'm installing a Fedora 13 virtual host on a Fedora 13 system, like this: > > virt-install --ram 2048 --vcpus 4 --name test --os-type linux \ > --os-variant fedora13 --disk /var/lib/libvirt/images/test.img,size=10 \ > --cdrom /var/lib/libvirt/Fedora-13-x86_64-DVD.iso --vnc --noautoconsole > > I connect to the installer using virt-manager, and the install appears to > complete successfully. Then, I reboot the virtual machine and reconnect > with virt-manager. What I see is this: > > Starting SeaBios (version 0.5.1) > > gPXE (http://etherboot.org) - 00:04.0 C900 PCI2.10 PnP BBS PMM7FE0 10 C900 > > Booting from Hard Disk... > > If I connect to the VM's console using 'virsh console', there's no output > at all. I don't see anything in /var/log/messages or /var/log/libvirt that > looks like an error. > > So, I'm not sure what's going on here, as this is the first time I've done > anything with virtualization. Has my VM hung, or is this what's supposed to > happen? I was expecting that somewhere along the line that my VM would get > an IP address via DHCP so I could SSH to it, but don't see anything indicatin > g > that has happend, or what the IP address is if it has. Is something broken > here, or have I missed a crucial step? > Follow-up: The problem was having hardware virtualization support turned off in the host's BIOS. (Doh!) Once I turned that on, not only was installing a guest about 10x faster, but it also booted properly afterward.
https://www.redhat.com/archives/libvirt-users/2010-June/msg00087.html
Source: Wikipedia
http://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine
http://jwang3417.blogspot.com/2010/02/kvm-on-ubuntu-and-fedora.html
HOWTO: Resize a KVM Virtual Machine Image
http://itsignals.cascadia.com.au/?p=28
http://wiki.libvirt.org/page/Tips
No comments:
Post a Comment