Reputation: 11
I created a qcow2
disk using qemu-img
, i.e.:
qemu-img create -f qcow2 -F qcow2 -b /home/user/Downloads/bionic-server-cloudimg-amd64.img ./ex-os.img 10G
Next I tried to create a VM using virt-install
in the following way:
virt-install --name os-test \
--memory 2048 \
--vcpus 2 \
--disk path=ex-os.img,device=disk \
--import \
--os-variant ubuntu20.04 \
--graphics none \
--console pty,target_type=serial
This works, and installation begins however when I try to do the same using sudo
priveleges, it fails.
sudo virt-install --name os-test \
--memory 2048 \
--vcpus 2 \
--disk path=ex-os.img,device=disk \
--import \
--os-variant ubuntu20.04 \
--graphics none \
--console pty,target_type=serial
[sudo] password for user:
Starting install...
ERROR internal error: process exited while connecting to monitor: 2024-01-14T05:07:35.714023Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/home/user/Downloads/bionic-server-cloudimg-amd64.img","node-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/home/user/Downloads/bionic-server-cloudimg-amd64.img': Permission denied
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
virsh --connect qemu:///system start os-test
otherwise, please restart your installation.
I have tried giving 777
permission to the img itself, but I still get Permission Denied
chmod 777 /home/user/Downloads/bionic-server-cloudimg-amd64.img
What can I try next?
Upvotes: 0
Views: 1298