Use Clear for a VM host

Short answer: Yes, you can have Windows VM in CL (I use one in my office).

Long answer: You will use the KVM hypervisor, the native hypervisor from linux.

To mange it will use libvirt as backend and virt-manager as front-end.

  1. install the virt-manager-gui and kvm-host bundles
  2. enable (to be ready every boot) libvirt service with sudo systemctl enable libvirtd.service
  3. start libvirt service with sudo systemctl start libvirtd.service
  4. run virt-manager

There you can select an ISO file to install your windows.

10 Likes

Thanks, KVM will work. Been a long time since I’ve used it but it will work.

I can confirm QEMU as well as that is my go-to. I have Win 7, Kali, and ClearLinux as well running just fine. Took a little work, I will post something in Q&A when I have time.

Hi and thanks for your instructions. I’m new to CL, have been ditching win recently and looking around for a good linux desktop env. I love CL look and philosophy. I was able to install win10 on virt-manager following your instructions but failed in setting the network for it, the guest does not see any network. Can anyone help please?

try with
https://wiki.libvirt.org/page/TaskNATSetupVirtManager

2 Likes

Also CL is adding Gnome-boxes which is an easy way to use VM.

1 Like

Thanks for your reply… Gnome-boxes was my first choice but it kept on telling me that virtualization was not enabled while I’m super sure it was… and it fails during creation. If there is a way to fix that I’d be more thank happy to use it and/or to support to fix it. My laptop is a Lenovo x1 carbon yoga.

I tried but it does not create any network, it ends with no msg but nothing gets added to the list. I also do not have any default network enabled on that screen.

I tried the following (after some investigation): “sudo virsh net-list --all” and I get an empty list back.

What am I doing wrong?

Thanks again for your patience

I get the same warning about virtualisation not being enabled when using the Flatpak build. I am unable to startup the standard build.

How did you get kvm modules to load? I’m on the latest native kernel (5.2.8.821) for x86_64 with kernel-native-dkms and kvm-host bundles installed but still no dice?

Just as a sanity check virtualization extensions are enabled in the bios & kernel modules look to be included (all be it x86?)

bjc@bjc-xps~ $ egrep -c '(vmx|svm)' /proc/cpuinfo
8
bjc@bjc-xps~ $ grep 'kvm' /lib/modules/5.2.8-821.native/modules.builtin
kernel/arch/x86/kvm/kvm.ko
kernel/arch/x86/kvm/kvm-intel.ko
kernel/drivers/gpu/drm/i915/gvt/kvmgt.ko
bjc@bjc-xps~ $ lsmod | grep kvm
bjc@bjc-xps~ $ 

And just in case the kvm modules are separate bundles

bjc@bjc-xps~ $ sudo swupd search kvm.ko
Search failed, no reasonable results found
bjc@bjc-xps~ $ sudo swupd search kvm_intel.ko
Search failed, no reasonable results found
bjc@bjc-xps~ $ 

I can’t help but think im missing something (or something has changed in the build that results in kvm modules not being available?)

They are built into the kernel, so you won’t find them by searching the .ko module names.

$ cat /usr/lib/kernel/config-5.2.8-821.native | grep CONFIG_KVM

CONFIG_KVM=y
CONFIG_KVM_INTEL=y

1 Like

Thanks @puneetse, after your feedback I did a quick google to dive a bit deeper and it looks like my problem stems from flatpak, (specifically not being able to start the android emulator from within intellij application)

I checked running the emulator from the command line and everything works fine so now to work out how flatpak encapsulates groups so that my users kvm groups cascade through.

Thanks for your help!

Hot tip for anyone that hits this issue. For me it was because Intelllij IDEA with android plugin (not Android Studio) didn’t get passed in the appropriate flatpak permissions so I rectified this by editing the application’s .desktop file to contain the --device kvm within the Exec field:

bjc@bjc-xps~ $ cat .local/share/flatpak/exports/share/applications/com.jetbrains.IntelliJ-IDEA-Community.desktop 
[Desktop Entry]
Categories=Development;IDE;
Exec=/usr/bin/flatpak run --branch=stable --arch=x86_64 --device=kvm --command=idea com.jetbrains.IntelliJ-IDEA-Community
GenericName=Capable and Ergonomic Java IDE
Icon=com.jetbrains.IntelliJ-IDEA-Community
Keywords=development;idea;intellij;java;
Name=IntelliJ IDEA Community
StartupNotify=true
StartupWMClass=jetbrains-idea-ce
Terminal=false
Type=Application
X-Flatpak=com.jetbrains.IntelliJ-IDEA-Community```
2 Likes

I was able to install VirtualBox in CL.

download the “all distributions” version of virtualbox
https://download.virtualbox.org/virtualbox/6.1.4/VirtualBox-6.1.4-136177-Linux_amd64.run
install dkms
sudo swupd bundle-add kernel-native-dkms
or for lts
sudo swupd search kernel-lts2018-dkms
run /sbin/vboxconfig

easy as that!

1 Like

Just for the sake of completion. If someone like to use the Gnome Boxes Flatpak, you also need to install kvm-host and add your user to the kvm group like so:

$ sudo swupd bundle-add kvm-host
$ sudo usermod -a -G kvm `whoami`

You can type in your username directly if you don’t want to use whoami.

If you need USB redirection and file share, use the bundle (sudo swupd bundle-add gnome-boxes).

1 Like

Trying to install win 10 from installation dvd but VM doesn’t recognize operating system on dvd. But when I use a CL iso it does recognize linux. Does VM only work using iso or do I have to do more with KVM??

I would like to add that there is also cockpit, which has an interface for managing vms as well as docker containers.

sudo swupd bundle-add cockpit
sudo systemctl enable --now cockpit.socket

desktop:

firefox localhost:9090

headless server:
navigate to http://my-servers-ip-or-fqdn:9090

2 Likes

Hi All,
Was anyone able to create a VM through Cockpit in Clear Linux?

Thanks in advance.

Regards,

1 Like

No. It was working at one point but it’s currently broken.

Thanks @inmanturbo. Indeed, I saw these bug requests.
I was surprised it didn’t work, because I’ve tested Clear Linux in a virtual machine and this was working.
Also, Docker was working fine. Something which disappeared as well in the later releases.
Hopefully it will come back.

Just a FYI for anyone with a Xeon Phi processor on board (not the coprocessor board, the processor!)

It has no hardware support for virtualization, so nothing you do will work on it.

1 Like