DEV Community

Harry Tanama
Harry Tanama

Posted on

How to Modify the Location of the Virtual Machine Image

Use the command virsh edit <image_name>
Do not include the extension .qcow2
example:

virsh edit debian13
Enter fullscreen mode Exit fullscreen mode

Edit the location of the source file of your VirtIO Disk1:

After you make the changes using nano and now you can exit by pressing ctrl + x and Y to Save modified buffer?

And leave the file name /temp/virshPC0BB3.xml do not edit this file name, the virsh command or application will take care the modification of your virtual disk location at the backend

Just hit enter to accept the changes.

After that you need to cp the actual file to the new directory and you need to be a superuser to perform this action:

root@pop-os:/var/lib/libvirt/images# cp debian13.qcow2 /path/location/of_your_choosing
Enter fullscreen mode Exit fullscreen mode

The name of the virtual disk location must match to the location of the actual file:


Top comments (0)