Forums

Duncan
Duncan
Offline
Resolved
0 votes
Installing KVM with virt-manager to remotely administer machine creation and processes is a relatively simple matter on Clearos. I am running this on 6.5 but I did a quick test with 6.6 and it appeared to work.

There is an option to setup unattended backups of guest machines by use of a script I have outlined below. If you don't feel that backups are important (i.e. machines that rarely change over time) then just install your system as normal. The script requires a separate LVM partition to backup to because it performs and mounts LVM snapshots of the partition the guests live on. The screen shot below is only a suggestion on how to partition for the script. The partition sizes are up to you and you should base them on what you think you will require. It is important to leave some free space at the end of the disk for the temporary snapshots (say 20 gig).

http://i58.tinypic.com/jtnns8.jpg

You could if you like set up a separate disk for your backups or guests and this can be done fairly simply at the time of installation or after.

We are using x2goserver to provide the remote virt-manager presence on windows - all that is needed is to install the client for your particular OS. Something seemed to change recently with the repos so for the time being I just enable all the repos for the install.

yum --enablerepo=* install kvm libvirt virt-manager x2goserver


This will install all of the required software and dependancies needed.


Because libvirt uses its own dnsmasq process we need to make a small adjustment to the Clearos dnsmasq process.

nano /etc/dnsmasq.conf


and add the following lines to the end

bind-interfaces
except-interface=virbr0

to effect the change we need to restart dnsmasq and start libvirt.

service dnsmasq restart
service libvirtd start


From your x2go client set up a session using your ssh credentials (root) to connect. Where it asks for session type select single session and use the following in the command box.

virt-manager --no-fork


You should be able to run the session and a virt-manager box will open on your client machine. From here you can set up, configure and run machines remotely from your server. I have a method for setting up and installing openvswitch to do the bridging which I will put up when I get the chance but this method is probably the better method if you are using a single interface.

http://www.clearcenter.com/support/documentation/clearos_guides/adding_bridged_interfaces
Friday, February 20 2015, 09:12 AM
Share this post:
Responses (4)
  • Accepted Answer

    Friday, February 20 2015, 10:16 AM - #Permalink
    Resolved
    0 votes
    Hi Duncan

    Excellent Topic :)

    One typo I found:
    service libvirtd start

    and it works 100% on 6.6
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Friday, February 20 2015, 09:23 AM - #Permalink
    Resolved
    0 votes
    Tips and tricks

    It might be possible to do hardware passthrough (with vt-d enabled processors and motherboards) using Tims 3.13 kernel here.

    http://www.clearfoundation.com/component/option,com_kunena/Itemid,232/catid,40/func,view/id,50750/

    What does that mean? We could directly assign graphic cards to virtual machines or perhaps passthrough tv capture cards to virtual machines for recording tv shows.


    Windows will run a great deal faster using virtio hardware (hard drives) however unlike linux it doesnt have the virtio drivers built into it's operating system. The way to handle this is to download the virtio iso and mount it as a second cdrom in the machines hardware. Set up the harddrive as virtio and boot the machine. When you get to the partitioning portion of the install process the installer will complain that it cant find any drive. Select the add hardware dialog and browse the second cdrom for your OS version and 32/64 bit driver configuration. After you have installed the driver the harddrive will appear and the installation can proceed as usual.
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Friday, February 20 2015, 09:21 AM - #Permalink
    Resolved
    0 votes
    Backing up guest machines.

    There is a great script available that will back up a running virtual machine by taking a snapshot of the machine and performing the backup from there. It is available here from firewall-services.

    Create the script on your server

    nano virt-backup.pl


    copy and paste the contents into the script. ctrl-x to save the script and then make it executable.

    chmod +x virt-backup.pl


    and then run the script

    ./virt-backup.pl --debug  --vm=XXXXXXXX


    The default backup location is /var/lib/libvirt/backup so it needs to exist for the script to work correctly. You can edit the script to change the location if needed to suit your layout.

    If you have empty space on your LVM partition the script will pause the machine, setup a snapshot, resume the machine and then perform the backup. If you have a standard Clearos install the script will pause the machine, do the backup and then resume the machine when done.

    It is obviously important to test the backup initially to prove the system. The script could be run from cron to provide unattended backups.
    The reply is currently minimized Show
  • Accepted Answer

    Duncan
    Duncan
    Offline
    Friday, February 20 2015, 09:15 AM - #Permalink
    Resolved
    0 votes
    Reserved for openvswitch
    The reply is currently minimized Show
Your Reply