Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
home_server:home_server_setup:kvm [2023-07-29 Sat wk30 14:55] – [KVM Backup] baumkp | home_server:home_server_setup:kvm [2025-02-08 Sat wk06 17:11] (current) – [kvm back-up links] baumkp | ||
---|---|---|---|
Line 5: | Line 5: | ||
*[[https:// | *[[https:// | ||
*[[https:// | *[[https:// | ||
- | *[[https:// | + | *[[https:// |
*[[https:// | *[[https:// | ||
Basically to install the KVM Hypervisor: '' | Basically to install the KVM Hypervisor: '' | ||
Line 49: | Line 49: | ||
====Windows10 on KVM==== | ====Windows10 on KVM==== | ||
+ | I have not used Windows on a VM now since circa 2021. Just no need. I do have a dual boot on my main desk top that I default to Debian testing and can boot to Windows 11 when I need to use Windows based software. | ||
I had poor performance on Windows 7, 8/8.1, and 10 running on KVM a few years back. A large frustration was that I could not seem to get more than 2 CPUs functioning on the Windows VM even though I assigned 4. Performance was very poor, with CPU usage usually saturated with any use and relatively high even when idle. I found out early that Windows has limitations on the number of CPUs that could be used; 1 on Home, 2 on professional and 4 on Workstation and more on Server versions, at least that was my understanding. | I had poor performance on Windows 7, 8/8.1, and 10 running on KVM a few years back. A large frustration was that I could not seem to get more than 2 CPUs functioning on the Windows VM even though I assigned 4. Performance was very poor, with CPU usage usually saturated with any use and relatively high even when idle. I found out early that Windows has limitations on the number of CPUs that could be used; 1 on Home, 2 on professional and 4 on Workstation and more on Server versions, at least that was my understanding. | ||
Line 63: | Line 64: | ||
---- | ---- | ||
=====KVM Backup===== | =====KVM Backup===== | ||
- | There seems to be 4 main ways to backup a KVM virual machine | + | There seems to be 3 main ways to backup a KVM virual machine: |
- | - Copy the main file(s) while the VM is running | + | |
- | - Not recommended as file corruption will probably occur as the VM operation may and probably will modify the file during the copy process | + | |
- Shutdown the VM first and then copy the file. Start the VM again after the copy is completed. | - Shutdown the VM first and then copy the file. Start the VM again after the copy is completed. | ||
- Use virsh backup-begin command to allow live full backup | - Use virsh backup-begin command to allow live full backup | ||
Line 71: | Line 70: | ||
- Create a snapshot of the VM and direct all changes to the snapshot allowing safe backup of main VM file | - Create a snapshot of the VM and direct all changes to the snapshot allowing safe backup of main VM file | ||
- Active back commit the snapshot and verify back commit worked | - Active back commit the snapshot and verify back commit worked | ||
+ | * Copy the main file(s) while the VM is running | ||
+ | - <fc # | ||
====KVM Offline Backup==== | ====KVM Offline Backup==== | ||
- | Note this only works on VMs that are shut down. | + | <fc #ff0000>Note this only works on VMs that are shut down</fc> |
-'' | -'' | ||
- | -'' | + | -'' |
-'' | -'' | ||
- | -'' | + | -'' |
+ | -'' | ||
+ | -'' | ||
+ | |||
+ | |||
+ | *[[https:// | ||
+ | |||
+ | References: | ||
+ | *[[https:// | ||
====kvm back-up links==== | ====kvm back-up links==== | ||
- | *[[https:// | + | *[[https:// |
- | *[[https:// | + | *[[https:// |
*[[https:// | *[[https:// | ||
*[[https:// | *[[https:// | ||
Line 98: | Line 106: | ||
* '' | * '' | ||
* '' | * '' | ||
+ | * '' | ||
* virsh : start, shutdown, destroy, reboot, or pause (suspend / resume) | * virsh : start, shutdown, destroy, reboot, or pause (suspend / resume) | ||
* '' | * '' | ||
Line 116: | Line 125: | ||
====Change the Disk Allocated Size==== | ====Change the Disk Allocated Size==== | ||
How to change the amount of disk space assigned to a KVM *[[https:// | How to change the amount of disk space assigned to a KVM *[[https:// | ||
- | *First turn off the virtual machine to be checked | + | *First, **turn off the virtual machine** to be checked |
*Next find the file location of the virtual machine to be checked | *Next find the file location of the virtual machine to be checked | ||
*Next query the file: '' | *Next query the file: '' | ||
*Next increase the allowed size of the vm disk: '' | *Next increase the allowed size of the vm disk: '' | ||
*We need to make a backup of the VM disk: '' | *We need to make a backup of the VM disk: '' | ||
+ | *We can check the file system on the VM: '' | ||
+ | *We the backup VM disk to create a new expanded drive: '' | ||
+ | |||
+ | The '' | ||
[[https:// | [[https:// | ||
====Shrink the Disk File==== | ====Shrink the Disk File==== | ||
*Locate the QEMU disk file | *Locate the QEMU disk file | ||
- | *Shut down the VM. | + | |
*Copy the VM file to a back-up: '' | *Copy the VM file to a back-up: '' | ||
*Option #1: Shrink your disk without compression (better performance, | *Option #1: Shrink your disk without compression (better performance, |