jcorbet Posted March 23, 2019 Posted March 23, 2019 Hi forum, I want to try out KVM virtualization since I found out that Odroid HC-1 (=Odroid XU4) does in fact support hardware virtualization and should therefore have a good performance. (Is this true, has someone already done this and can confirm?) In the past I have worked with other virtualization software but this would be my first time to use kvm. Not long ago I started a server projet which works very very well and serves all my needs. The little board is so efficient indeed that I got more than 1GB of unused RAM and also a lot of unused performance. Therefore I wondered whether I could safely use the board to virtualize an environment where I could safely try out things and have some remote desktop experience. Since the board also has an onboard GPU which sits idle (since I am using the minimal version as I do not need graphical output for some fileserver) maybe one could even use it to watch youtube remotely (when it is blocked in your office or something like that). So long story short: How do I get KVM running and get myself a *nix guest which I can log into via vnc or rdp or some other protocol? And would it be worthwhile or will the performance basically be rubbish? My research: Guest OS: Obviously I would like to try out Armbian as a guest since it is a very well maintained distro and a dream performance wise (thank you so much!). Since KVM is able to overprovision I can pass on all of the boards capabilities to the guest and do not have to artifically split the memory between host an guest. However I got no experience with armbian as a guest. I know it is very optimized for the boards it supports so I really got no clue whether this idea is any good. Is this a good idea? Host/KVM: I am running 18.04.2 LTS. Some people claim that KVM is already enabled while other guides claim it is not enabled. (See: https://magazine.odroid.com/article/kvm-odroid-xu4/ and https://www.hardkernel.com/blog-2/ubuntu-18-04-for-odroid-xu4/). So ... I do not now where I am and I do not know what to do. I will experiment with the board now (did a fresh image of the ssd where my filesystem resides). And so I will venture into the unknown - unless someone gut some knowledge here Would be very appreciated Can I work with this guide: https://wiki.odroid.com/odroid-xu4/application_note/software/kvm Kernel 4.14 is installed here. I do not know whether armbian differs from vanilla in this regard ... So I checked and armbian uses it's own improved dtb. Can I somehow have the improved armbian dtb and have kvm? If so, how do I do it? May be a silly question but I have never before compiled my own kernel, so this will be a first :). This is the related config, it seems: https://github.com/hardkernel/linux/blob/odroidxu4-4.14.y/arch/arm/configs/odroidxu4_kvm_defconfig I do not understand a thing except for that I am not suppoesed to touch it. Funnily though when I try to follow this guide I get this error when calling make for the first time: make odroidxu4_kvm_defconfig HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf *** *** Can't find default configuration "arch/arm/configs/odroidxu4_kvm_defconfig"! *** scripts/kconfig/Makefile:112: recipe for target 'odroidxu4_kvm_defconfig' failed make[1]: *** [odroidxu4_kvm_defconfig] Error 1 Makefile:547: recipe for target 'odroidxu4_kvm_defconfig' failed make: *** [odroidxu4_kvm_defconfig] Error 2 So I think I would be better of following some other guide. ...
lanefu Posted March 24, 2019 Posted March 24, 2019 The easiest way to build the kernel will be to use the armbian build tool. You can modify the kernel settings from its interface. https://docs.armbian.com/Developer-Guide_Build-Preparation/For your guest OSs just use a vanilla ARM Debian or Ubuntu install, it’s going to provide a UEFI for the guest to use so you don’t need to worry about u-boot and all the other SBC nuances armbian addresses.Sent from my iPad using Tapatalk
jcorbet Posted March 24, 2019 Author Posted March 24, 2019 Thank you for your answer. Can you explain to me how to exactly configure the kernel for KVM? I can for sure setup the buldenvironment and stuff .. but then I am a bit clueless what to do? What do I have to adjust? And where do I find the data? And when the process runs how do I update my existing installation with the new stuff? Is there some general guide on compiling ARMbian with KVM?
lanefu Posted March 24, 2019 Posted March 24, 2019 Sorry I can only give you a quick summary, but should be enough:* Run the build tools* Choose your board* Say yes to modify kernel configuration* Look around the menus and find the kvm and virtualization stuff* Install your new kernel packages or new system image* Resume following along in your Odroid tutorial Sent from my iPad using Tapatalk
jcorbet Posted March 24, 2019 Author Posted March 24, 2019 Hi. I am now at looking around and modifying things. Oh man - there is so much to decide. Can I safely make appropiate decisions or should I only make the slightest modification possible solving the problem? Any way: I have found virtualization support, but I have not actually found KVM. I diffed the two configs of hardkernel to look for the options. Yet I do not seem to have every option that they tick. Have a look: https://www.diffchecker.com/y8uJifYA (right at the end is the most juicy stuff regarding KVM) What does this mean? EDIT (again): I also cannot locate where one can choose between different timers like it was mentioned in the guide.
Igor Posted March 25, 2019 Posted March 25, 2019 On 3/23/2019 at 9:10 PM, jcorbet said: This is the related config, it seems: https://github.com/hardkernel/linux/blob/odroidxu4-4.14.y/arch/arm/configs/odroidxu4_kvm_defconfig Download this config and use when building kernel. To do that, copy content to userpatches/linux-odroidxu4-default.config or userpatches/linux-odroidxu4-next.config and rebuild kernel. The best would be to merge with our configuration, but that will be some work.
jcorbet Posted March 30, 2019 Author Posted March 30, 2019 So, now I compiled the kernel with the script and also managed to install the .deb packages. Then I checked for kvm support via dmesg | grep but found none. Ultimately I chose to delete all dtb files in the dtb-latest folder under /boot but the one tagged xu4-kvm, but this resulted in the machine failing to start. Luckily I have made a backup so I could go back. However I have no clue what goes wrong and even more important I do not know how to find out. What should I be looking for? Edit: I have got the machine running again. It was me having set (correctly at the time) the hc1 config via armbian-config. I now found the ArmbianEnv text file, so ... I entered xu4-kvm as "board_name". board_name=xu4-kvm rootdev=UUID=4adb9ebc-d03b-4b14-a3d2-f0a3315c7f00 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u Yet, when I run "dmesg | grep kvm" I do not see any support of virtualization despite the boards hardware virtualization capabilities. So ... what to do now? Board runs WITH NEW KERNEL. I can verify things happened lately. (See timestamps). I can verify the kernel I compiled with the config from hardkernel and your build-process is in fact *.107. So ...? Edit2: I also tried adding an overlays parameter to ArmbianEnv, but still I got no kvm support. The machine also works flawlessly. Which is strange. Anyways - this is my current NOT working as expected config: board_name=xu4 overlays=xu4-kvm rootdev=UUID=4adb9ebc-d03b-4b14-a3d2-f0a3315c7f00 rootfstype=ext4 usbstoragequirks=0x2537:0x1066:u,0x2537:0x1068:u I still am completely in the dark what goes on here. Edit 3: I found a line in the boot.ini where I could set the kvm dtb. But it changed nothing :(. This really sucks!
Recommended Posts