QEMU/KVM on ThinkPad X230T Laptop with Dual-boot: Difference between revisions

From WikiMLT
mNo edit summary
Line 1: Line 1:
<noinclude>{{ContentArticleHeader/Virtual_Machines}}</noinclude>
<noinclude>{{ContentArticleHeader/Virtual_Machines}}</noinclude>
I was in need to access Windows 10 from Kali Linux on my dual booted Lenovo ThinkPad X230T device. So here are the things I've done to achieve that.


== Test the Virtualization Capabilities of the System ==
== Test the Virtualization Capabilities of the System ==
Check weather the system supports virtualisation. The following command must return at least <code>1</code>:
Check weather the system supports virtualization and it is enabled via the BIOS. The following command must return at least <code>1</code>:
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
egrep -c '(vmx|svm)' /proc/cpuinfo
egrep -c '(vmx|svm)' /proc/cpuinfo
Line 8: Line 9:
== Install QEMU, KVM, LIBVIRT ==
== Install QEMU, KVM, LIBVIRT ==
<syntaxhighlight lang="shell" line="1">
<syntaxhighlight lang="shell" line="1">
sudo apt install qemu-system-x86 libvirt-daemon libvirt-clients bridge-utils virt-manager virtinst libosinfo-bin ovmf
sudo apt install qemu-system-x86 libvirt-daemon libvirt-clients bridge-utils virt-manager virtinst libosinfo-bin ovmf remmina
</syntaxhighlight>To get rid of the password dialogue - ''"System policy prevents management of local virtualization systems"'' - I've added my Linux user to the <code>libvirt</code> group.<syntaxhighlight lang="shell" line="1">
sudo usermod -aG libvirt $USER
</syntaxhighlight>
</syntaxhighlight>
----<syntaxhighlight lang="xml" line="1">
 
== Setup the virtual machine ==
The setup of the virtual machine is done via the <code>virt-manager</code> GUI.<syntaxhighlight lang="xml" line="1">
<disk type="block" device="disk">
<disk type="block" device="disk">
   <driver name="qemu" type="raw" cache="none" discard="unmap"/>
   <driver name="qemu" type="raw" cache="none" discard="unmap"/>

Revision as of 17:59, 12 August 2022

I was in need to ac­cess Win­dows 10 from Kali Lin­ux on my dual boot­ed Leno­vo ThinkPad X230T de­vice. So here are the things I've done to achieve that.

Test the Vir­tu­al­iza­tion Ca­pa­bil­i­ties of the Sys­tem

Check weath­er the sys­tem sup­ports vir­tu­al­iza­tion and it is en­abled via the BIOS. The fol­low­ing com­mand must re­turn at least 1:

egrep -c '(vmx|svm)' /proc/cpuinfo

In­stall QE­MU, KVM, LIB­VIRT

sudo apt install qemu-system-x86 libvirt-daemon libvirt-clients bridge-utils virt-manager virtinst libosinfo-bin ovmf remmina

To get rid of the pass­word di­a­logue – "Sys­tem pol­i­cy pre­vents man­age­ment of lo­cal vir­tu­al­iza­tion sys­tems" – I've added my Lin­ux user to the lib­virt group.

sudo usermod -aG libvirt $USER

Set­up the vir­tu­al ma­chine

The set­up of the vir­tu­al ma­chine is done via the virt-man­ag­er GUI.

<disk type="block" device="disk">
  <driver name="qemu" type="raw" cache="none" discard="unmap"/>
  <source dev="/dev/sda"/>
  <target dev="sda" bus="sata"/>
  <address type="drive" controller="0" bus="0" target="0" unit="0"/>
</disk>