[ANN] Introducing vms - more qemu virtual machines !
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using this for quite some time now. It has grown from using custom scripts inspired by Alien Bob's qemu posts and scripts. I have been running with this various linux distros, BSD's, minix, MacOS, windows etc. It has also been used with pci-stub and vfio-pci passthrough for having available hardware in the vm, such as pci graphics and audio cards or the whole usb bridge. See https://bitbucket.org/yotis/vms/src/...sbin/vfio-bind
I find it useful, maybe it will be for others useful too. Any feedback and contribution is more than welcome
I will also submit a SlackBuild to slackbuilds.org.
Last edited by ninikos; 08-30-2018 at 08:51 AM.
Reason: updated package link with vms-0.2.1
Well, I am by no means expert on libvirt. First of all, vms is very small. The slackware package is around 10K. It also has minimal dependencies. Namely bash, qemu, socat, vde2, tigervnc. Being very simple and written in bash, it can be easily understood and customized.
The main utility vms supports a very simple interface.
vms uses a simple configuration file ~/.vms/vms.conf for configuring the virtual machines per user that declares one bash associative array for each virtual machine. Much simpler than dealing with XML configuration files that the managing tools are messing around with your edits. A complete working minimal vms.conf example would be like this.
I started using a set of scripts based on alienbob's qemu and vde scripts. This was in 2012-2013. Back then, I wanted to run virtual machines with pci passthrough for graphics cards. IIRC I tried to do this with CentOS, ubuntu, debian, .. None of them could do it. The main problem was that specific kernels and packages where needed for this to work. That was one of the reasons I tried slackware and it is the only system I use now. I could only do pci passthrough with slackware64-14.0, only with the scripts and custom kernels. libvirt was giving me a lot of problems and pci passthrough was not working with it at the time. So, after a lot of copying and evolving those scripts, vms was created, at first as an easy fast way to create a virtual machine and manage a set of them in one file easily.
I will upload soon a 0.1.2 version that has some manpages, with some more examples and documentation how to use it.
Last edited by ninikos; 08-26-2018 at 10:22 AM.
Reason: Typo in code
I just uploaded another package, vms-0.1.2, it has man pages for vms and vms.conf. In there there are some more examples. See the first post for download link.
I installed vms-0.1.2-noarch-1did.tgz and read the man pages first. Then I created $HOME/.vms/vms.conf (file is attached) and ran "vms create vslack01" and got an error message that it can't find '/var/lib/vms/vm.sh'. I found '/var/lib/vms/vm.sh.new' instead, so I renamed it. When I started that command again, it complained that
Quote:
vslack01 already exists
But the directory $HOME/.vms/vslack01/ was empty so I copied the script manually with
The command "vms create vslack01" created a new array named vslack01 into vms.conf so I deleted it since I already created it before running that command.
About /var/lib/vms/vm.sh.new, it is indeed a packaging issue, I forgot to add a line to doinst.sh, it will be ok with the next package.
The easiest way to start is by
Code:
$ vms create vmslack01
You do this or you create the files by hand like this and then add the first lines by hand in ~/.vms/vms.conf
I just tried your config. I created the image files, so I did not touch vslack01 config at all and it works just fine. Are you sure your .qcow2 and .iso files exist?
What qemu version are you using? I am using here 2.9.0. From the error message you get I think it tries to attach a disk device where another one is already attached. Can you try modifing the disk like this?
I think this would be better posted in the generic Linux forum. Granted it comes with Slackware packages but it won't be rocket science to get it working with other distros.
I think this would be better posted in the generic Linux forum. Granted it comes with Slackware packages but it won't be rocket science to get it working with other distros.
Well, I think the vms command will work with very little effort. Some path adjustments maybe are needed for the init script. Even if I am using this for two years now, I haven't tested it with any other distributions. Maybe this will be an excuse to try nested kvm.
I was very temped to write this in python. Python dictionaries are much more easy to work with than bash associative arrays. The main reasons that I left it in bash until now are that bash can be very easily customized and as it is, it has minimal dependencies.
It has many little fixes, some performance improvements, much more polished and tested examples and man pages and saner output to the user. I think this is the most polished version so far. If you tried any of the previous ones, please try again.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.