How to switch between KVM and VirtualBox on Ubuntu 18.04

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I'm using VirtualBox for some projects that I'm working on but also want to use KVM. I know that I can't use both at the same time, because of VirtualBox which refuses to start with an error like: VERR_VMX_IN_VMX_ROOT_MODE



Now I thought it would be easy to stop all KVM / libvirtd services and after that to unload the KVM modules like so:



$ sudo systemctl stop libvirtd
$ sudo modprobe -r kvm_intel
$ sudo modprobe -r kvm


But when I try to unload the KVM modules, modprobe tells me that these modules are still in use.



When I check systemctl for other running services with libvirt in its name, it also lists:



$ sudo systemctl list-unit-files| grep libvirt
libvirt-bin.service enabled
libvirt-guests.service enabled
libvirtd.service enabled


and



$ sudo systemctl list-unit-files| grep kvm 
qemu-kvm.service enabled


So I stopped them all, but even after that, something is using KVM.



I did a



$ sudo lsof | grep kvm 
qemu-syst 14745 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
qemu-syst 14745 14753 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 14753 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 14753 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 14753 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
CPUx200/ 14745 14761 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
CPUx200/ 14745 14761 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
CPUx200/ 14745 14761 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
CPUx200/ 14745 14761 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
SPICEx20 14745 14763 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
SPICEx20 14745 14763 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
SPICEx20 14745 14763 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
SPICEx20 14745 14763 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
kvm-pit/1 14762 root cwd DIR 253,0 4096 2 /
kvm-pit/1 14762 root rtd DIR 253,0 4096 2 /
kvm-pit/1 14762 root txt unknown /proc/14762/exe


and it seems that something is still running. Did I miss something that I have to stop in order to completely stop KVM?



I would like to put all relevant steps into a script so that I can easily start / stop KVM or VirtualBox...







share|improve this question





















  • KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
    – dsstorefile1
    May 8 at 7:39











  • Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
    – Marc
    May 8 at 7:48















up vote
0
down vote

favorite












I'm using VirtualBox for some projects that I'm working on but also want to use KVM. I know that I can't use both at the same time, because of VirtualBox which refuses to start with an error like: VERR_VMX_IN_VMX_ROOT_MODE



Now I thought it would be easy to stop all KVM / libvirtd services and after that to unload the KVM modules like so:



$ sudo systemctl stop libvirtd
$ sudo modprobe -r kvm_intel
$ sudo modprobe -r kvm


But when I try to unload the KVM modules, modprobe tells me that these modules are still in use.



When I check systemctl for other running services with libvirt in its name, it also lists:



$ sudo systemctl list-unit-files| grep libvirt
libvirt-bin.service enabled
libvirt-guests.service enabled
libvirtd.service enabled


and



$ sudo systemctl list-unit-files| grep kvm 
qemu-kvm.service enabled


So I stopped them all, but even after that, something is using KVM.



I did a



$ sudo lsof | grep kvm 
qemu-syst 14745 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
qemu-syst 14745 14753 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 14753 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 14753 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 14753 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
CPUx200/ 14745 14761 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
CPUx200/ 14745 14761 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
CPUx200/ 14745 14761 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
CPUx200/ 14745 14761 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
SPICEx20 14745 14763 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
SPICEx20 14745 14763 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
SPICEx20 14745 14763 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
SPICEx20 14745 14763 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
kvm-pit/1 14762 root cwd DIR 253,0 4096 2 /
kvm-pit/1 14762 root rtd DIR 253,0 4096 2 /
kvm-pit/1 14762 root txt unknown /proc/14762/exe


and it seems that something is still running. Did I miss something that I have to stop in order to completely stop KVM?



I would like to put all relevant steps into a script so that I can easily start / stop KVM or VirtualBox...







share|improve this question





















  • KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
    – dsstorefile1
    May 8 at 7:39











  • Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
    – Marc
    May 8 at 7:48













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm using VirtualBox for some projects that I'm working on but also want to use KVM. I know that I can't use both at the same time, because of VirtualBox which refuses to start with an error like: VERR_VMX_IN_VMX_ROOT_MODE



Now I thought it would be easy to stop all KVM / libvirtd services and after that to unload the KVM modules like so:



$ sudo systemctl stop libvirtd
$ sudo modprobe -r kvm_intel
$ sudo modprobe -r kvm


But when I try to unload the KVM modules, modprobe tells me that these modules are still in use.



When I check systemctl for other running services with libvirt in its name, it also lists:



$ sudo systemctl list-unit-files| grep libvirt
libvirt-bin.service enabled
libvirt-guests.service enabled
libvirtd.service enabled


and



$ sudo systemctl list-unit-files| grep kvm 
qemu-kvm.service enabled


So I stopped them all, but even after that, something is using KVM.



I did a



$ sudo lsof | grep kvm 
qemu-syst 14745 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
qemu-syst 14745 14753 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 14753 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 14753 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 14753 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
CPUx200/ 14745 14761 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
CPUx200/ 14745 14761 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
CPUx200/ 14745 14761 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
CPUx200/ 14745 14761 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
SPICEx20 14745 14763 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
SPICEx20 14745 14763 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
SPICEx20 14745 14763 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
SPICEx20 14745 14763 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
kvm-pit/1 14762 root cwd DIR 253,0 4096 2 /
kvm-pit/1 14762 root rtd DIR 253,0 4096 2 /
kvm-pit/1 14762 root txt unknown /proc/14762/exe


and it seems that something is still running. Did I miss something that I have to stop in order to completely stop KVM?



I would like to put all relevant steps into a script so that I can easily start / stop KVM or VirtualBox...







share|improve this question













I'm using VirtualBox for some projects that I'm working on but also want to use KVM. I know that I can't use both at the same time, because of VirtualBox which refuses to start with an error like: VERR_VMX_IN_VMX_ROOT_MODE



Now I thought it would be easy to stop all KVM / libvirtd services and after that to unload the KVM modules like so:



$ sudo systemctl stop libvirtd
$ sudo modprobe -r kvm_intel
$ sudo modprobe -r kvm


But when I try to unload the KVM modules, modprobe tells me that these modules are still in use.



When I check systemctl for other running services with libvirt in its name, it also lists:



$ sudo systemctl list-unit-files| grep libvirt
libvirt-bin.service enabled
libvirt-guests.service enabled
libvirtd.service enabled


and



$ sudo systemctl list-unit-files| grep kvm 
qemu-kvm.service enabled


So I stopped them all, but even after that, something is using KVM.



I did a



$ sudo lsof | grep kvm 
qemu-syst 14745 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
qemu-syst 14745 14753 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
qemu-syst 14745 14753 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
qemu-syst 14745 14753 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
qemu-syst 14745 14753 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
CPUx200/ 14745 14761 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
CPUx200/ 14745 14761 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
CPUx200/ 14745 14761 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
CPUx200/ 14745 14761 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
SPICEx20 14745 14763 libvirt-qemu mem REG 0,13 10646 anon_inode:kvm-vcpu (stat: No such file or directory)
SPICEx20 14745 14763 libvirt-qemu 11u CHR 10,232 0t0 551 /dev/kvm
SPICEx20 14745 14763 libvirt-qemu 12u a_inode 0,13 0 10646 kvm-vm
SPICEx20 14745 14763 libvirt-qemu 18u a_inode 0,13 0 10646 kvm-vcpu
kvm-pit/1 14762 root cwd DIR 253,0 4096 2 /
kvm-pit/1 14762 root rtd DIR 253,0 4096 2 /
kvm-pit/1 14762 root txt unknown /proc/14762/exe


and it seems that something is still running. Did I miss something that I have to stop in order to completely stop KVM?



I would like to put all relevant steps into a script so that I can easily start / stop KVM or VirtualBox...









share|improve this question












share|improve this question




share|improve this question








edited May 8 at 7:39
























asked May 8 at 7:33









Marc

1013




1013











  • KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
    – dsstorefile1
    May 8 at 7:39











  • Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
    – Marc
    May 8 at 7:48

















  • KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
    – dsstorefile1
    May 8 at 7:39











  • Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
    – Marc
    May 8 at 7:48
















KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
– dsstorefile1
May 8 at 7:39





KVM can't run VMs on its own and is often paired with QEMU to do the actual emulation. From your lsof output, QEMU (your VM) is still running.
– dsstorefile1
May 8 at 7:39













Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
– Marc
May 8 at 7:48





Sorry for my ambiguous use of the terms... But I made sure in virt-manager, that I stopped all the virtual machines. How can it be that qemu is still running?
– Marc
May 8 at 7:48
















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442480%2fhow-to-switch-between-kvm-and-virtualbox-on-ubuntu-18-04%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442480%2fhow-to-switch-between-kvm-and-virtualbox-on-ubuntu-18-04%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay