PVE Adopt a KVM Ubuntu Guest: Difference between revisions
mNo edit summary |
|||
Line 15: | Line 15: | ||
Setup the guest VM as it is shown at {{Media-cite|v|1}}. We will not perform a clean installation but will import a KVM image with Ubuntu Desktop 20.04. So after the creation of the VM we have to do few more steps before start it. UEFI BIOS is recommended for GPU passthrough at all, so we will use it. | Setup the guest VM as it is shown at {{Media-cite|v|1}}. We will not perform a clean installation but will import a KVM image with Ubuntu Desktop 20.04. So after the creation of the VM we have to do few more steps before start it. UEFI BIOS is recommended for GPU passthrough at all, so we will use it. | ||
''How to isolate the GPU, at the PVM host's side, to be ready for passthrough is described in the article [[PVE IOMMU Isolation for Passthrough]] and move details are provided in the article [[KVM and GPU Passthrough to Windows VM]].'' | ''How to isolate the GPU, at the PVM host's side, to be ready for passthrough is described in the article [[PVE IOMMU Isolation for Passthrough]] and move details are provided in the article [[QEMU/KVM and GPU Passthrough to Windows VM]].'' | ||
The disk image created at {{Media-cite|v|1}} has been deleted - let's remembered we will import an existing KVM Image - but with this approach we've reserved the name <code>vm-205-disk-0</code> for the primary VM's image. The CPU type <code>host</code> is important to allow virtualization at the guest side. | The disk image created at {{Media-cite|v|1}} has been deleted - let's remembered we will import an existing KVM Image - but with this approach we've reserved the name <code>vm-205-disk-0</code> for the primary VM's image. The CPU type <code>host</code> is important to allow virtualization at the guest side. | ||
== Convert the KVM Image into a Proxmox Image == | == Convert the KVM Image into a Proxmox Image == | ||
Create an new VM on Proxmox VE (already done) and add the existing disk image to this new VM (this step), set the boot order and start [https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE#Qemu.2FKVM source].<syntaxhighlight lang="shell" line="1" class="root-prompt"> | Create an new VM on Proxmox VE (already done) and add the existing disk image to this new VM (this step), set the boot order and start [https://pve.proxmox.com/wiki/Migration_of_servers_to_Proxmox_VE#Qemu.2FKVM source].<syntaxhighlight lang="shell" line="1" class="root-prompt"> | ||
Line 29: | Line 28: | ||
Successfully imported disk as 'unused0:local-lvm:vm-215-disk-0' | Successfully imported disk as 'unused0:local-lvm:vm-215-disk-0' | ||
</syntaxhighlight>In the above command: | </syntaxhighlight>In the above command: | ||
* <code>215</code> is the id of the VM. | * <code>215</code> is the id of the VM. | ||
* <code>Ubuntu.20.04.img</code> is the image that was created before. | * <code>Ubuntu.20.04.img</code> is the image that was created before. | ||
Line 64: | Line 62: | ||
vmgenid: 2c862f80-6be7-41e7-b523-5abfe21f0fef | vmgenid: 2c862f80-6be7-41e7-b523-5abfe21f0fef | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== References == | == References == | ||
* [[QEMU/KVM Guest tools]] | * [[QEMU/KVM Guest tools]] | ||
* [[pve:Migration_of_servers_to_Proxmox_VE#Qemu.2FKVM]] | * [[pve:Migration_of_servers_to_Proxmox_VE#Qemu.2FKVM]] | ||
<noinclude> | <noinclude> | ||
<div id='devStage'> | <div id='devStage'> |
Revision as of 09:00, 13 August 2022
Setup the Virtual Machine
Setup the guest VM as it is shown at Video 1. We will not perform a clean installation but will import a KVM image with Ubuntu Desktop 20.04. So after the creation of the VM we have to do few more steps before start it. UEFI BIOS is recommended for GPU passthrough at all, so we will use it.
How to isolate the GPU, at the PVM host's side, to be ready for passthrough is described in the article PVE IOMMU Isolation for Passthrough and move details are provided in the article QEMU/KVM and GPU Passthrough to Windows VM.
The disk image created at Video 1 has been deleted – let's remembered we will import an existing KVM Image – but with this approach we've reserved the name vm-205-disk‑0
for the primary VM's image. The CPU type host
is important to allow virtualization at the guest side.
Convert the KVM Image into a Proxmox Image
Create an new VM on Proxmox VE (already done) and add the existing disk image to this new VM (this step), set the boot order and start source.
qm importdisk 215 Ubuntu.20.04.img local-lvm
importing disk 'Windows.11.img' to VM 205 ...
Logical volume "vm-215-disk-0" created.
...this takes a while...
transferred 40.0 GiB of 40.0 GiB (100.00%)
Successfully imported disk as 'unused0:local-lvm:vm-215-disk-0'
In the above command:
215
is the id of the VM.Ubuntu.20.04.img
is the image that was created before.local-lvm
is the name of a storage as listed inpvesm status
.
qm importdisk
adds the image as unused disk to the virtual machine. Thus, making it the boot disk is still necessary.
qm set 215 --scsi0 local-lvm:vm-215-disk-0
update VM 215: -scsi0 local-lvm:vm-215-disk-0
Fine tuning of the Configuration file
Modify and add the lines marked in the above snippet. Note 215
is the id of the virtual machine. When the file is saved the relevant changes will be automatically applied and updated within the Proxmox's WEB GUI.
nano /etc/pve/qemu-server/215.conf
agent: 1,fstrim_cloned_disks=1
args: -cpu 'host,+kvm_pv_unhalt,+kvm_pv_eoi,hv_vendor_id=NV43FIX,kvm=off'
bios: ovmf
boot: order=scsi0
cores: 4
cpu: host,hidden=1,flags=+pcid
efidisk0: local-lvm:vm-215-disk-1,efitype=4m,pre-enrolled-keys=1,size=4M
ide2: none,media=cdrom
localtime: 0
machine: q35
memory: 4096
meta: creation-qemu=6.1.0,ctime=1647425960
name: Ubuntu.Desktop
net0: virtio=06:3D:E1:07:6A:0C,bridge=vmbr0,firewall=1
numa: 0
ostype: l26
scsi0: local-lvm:vm-215-disk-0,discard=on,size=40G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=d0ce2cb6-9c80-43e2-b79b-a07099b916e3
sockets: 1
vmgenid: 2c862f80-6be7-41e7-b523-5abfe21f0fef