KVM + Kimchi install script

script
kimchi
virtualization
kvm
hyperviser

#1

I’ve written a script that installs and configures KVM for virtualization and Kimchi as a GUI web front end, complete with a custom link on the Quickbox Dashboard. I’ve tested it on my live machine and in VMs, both Debian 8.7 with a fresh Quickbox install. Haven’t tried it out on Ubuntu yet, but I’ll spin a VM up later to test.

You will have to reboot after the script successfully completes.

You must be root to run this script or it won’t work. I found a line of Stack Overflow that I thought would check for that and ask for elevation, but it didn’t seem to work on my production box.

This should be considered in the testing phase and only tried by people that can understand what the script is doing and are comfortable fixing any issues that may arise. I encourage any suggestions for improvement that you can think of. I’m new to scripting and welcome any advice.

I don’t have any users other than myself on my seedbox, which is a physical dedicated server, so this setup makes sense for me, but it probably doesn’t if you’re sharing a box or using a VPS or other virtual machine to run your instance of quickbox.



#2

Hi, thanks for making this!

I’m currently installing it on Ubuntu 16.04, will report on how it went.

edit: Everything seems fine, apart from https errors, I’ll have to figure out how install my LetsEncrypt cert on nginx which is what the web UI seems to be running on.

edit2: If anyone else is facing the same problem, I edited /etc/nginx/conf.d/wok.conf to contain the same paths to certificate & private key I had in /etc/apache2/sites-enabled/defaul-ssl.conf .


#3

Glad to hear it’s working on Ubuntu 16, and thanks for the tip about the SSL.

Unfortunately kimchi is tied to nginx. I originally wrote a script to install webvirtmgr because it works with apache and seems to have more features, but in the end it seemed a bit buggy, more complicated, might be abandoned, and was probably overkill for a single host on quickbox. I do wish kimchi could work with snapshots, though.


#4

@slavetothesound

Just help me understand this - I need to have a server with Debian / Ubuntu installed. And also Quickbox installed. Then, if I run this script as root it will configure KVM and kimchi will provide the web console to manage VMs. And you have added Kimchi to the QB Dashboard.

Am I right or wrong?

And , one thing I need to know - The portion where you update grub. Will this not be risky because, if anything breaks it will lead to the system being inaccessible. The reason I ask this is because once I updated grub on a Hetzner server and then after reboot, I had to take hands on to get access again.


#5

Judging by this line HERE I would say, yes.


#6

@JMSolo
Thanks for that one. I saw that. Actually English is not my native language so I struggle sometimes to understand things which might be a little technical. That is why I wanted to know.


#7

I think you’re doing fantastic! English is my only language, so you are far more along than myself. :smiley:
That line was the only sure giveaway to me in regards to your question. As per updating grub, this shouldn’t be an issue as long as it is done properly. However, with Hetzner it’s easy to fire up rescue mode and mount the drive to fix any issues. From the looks of this, you should be ok to use this script, although it is not officially supported by QuickBox… I don’t see anything alarming in it.


#8

@JMSolo
Jason, I think the update grub part can be troublesome on Hetzner. I will try to explain - Quite sometime back, I updated Ubuntu and grub update packages were also part of it. Now, during update everything was fine. No errors, no warnings. After reboot, system just did not come up. I do not what happened but, soft reset, hard reset all failed to load the rescue system. The last option was to get console access. Even then it was problematic to get the system back.
My point being, grub issues are more complicated to solve than solving some software issue. Because most of the people here are not that much technically adept. Losing access due to grub issues might cause some panic. That is why. Nothing else.
I believe we should try this out on a spare server, not a live production one.


#9

Just to clarify. I was only weighing in an opinion as this will more than likely not ever be an official part of QuickBox. So, if anyone tries this and issues a dilemma on their server… that is on them.


#10

I’ve only done this a few time, but I believe it is the standard way for updating grub and I haven’t had any issues with grub that result from adding those two options to enable virtualization. If grub were to break I can imagine it would be very annoying to fix on a remote server.

I haven’t used this with a Hetzner server - I use a dedibox from online.net. I’ve been able to reboot when needed. I’m not an expert but I haven’t had any trouble.


#11

@slavetothesound

You are right. Generally grub updates should not cause any problem. But, if something breaks then it becomes very annoying. Specially with a remote server and all the data on it. The risk for technically not adept people will be quite big.
Like the issue I had. I ended up taking a LARA console to retrieve the server access.