Linux Lite Forums

Software - Support => Other => Topic started by: Rosika on January 20, 2023, 09:30:22 AM

Title: I did "sudo virt-manager"- help needed
Post by: Rosika on January 20, 2023, 09:30:22 AM
Hi all, 

oh dear, oh dear. I might have done something stupid and need your help and opinions
 :dft001:.

After my fresh install of Linux Lite 6.2. I wanted to get my virtual machines running again. The images are still present on my third partition and yesterday I installed qemu-system and virt-manager .

After that:
Code: [Select]
sudo usermod -aG libvirt rosika
(to add myself to the user group libvirt). After that I rebooted the system.

Now I wanted to create a new vm by importing the respective img-file, e.g. virtualdebian.img for my Debian vm.

For this I employed virt-manager. Yet I couldnīt import the img-file as virt-manager complained about not being allowed to do so.
In order to rectify the situation virt-manager offered me to do just that. Yet it still wouldnīt work. It didnīt have the respective rights.  :023:

So I looked around on the web and found here: https://askubuntu.com/questions/722034/permission-error-in-virtual-machine-manager :


Quote
I had the same issue as well. I fixed it by doing the following:

    Run virt-manager with sudo:

       
Code: [Select]
sudo virt-manager
    Attempt to create your VM. When the error dialog appears, click Yes to correct the error.

    What this does is change the user and group of your image file (to libvirt-qemu:libvirt-qemu if that's your virt-manager user).

    When you get to the next step, cancel the creation process and close virt-manager.

    Now relaunch virt-manager without sudo and attempt to create your VM again.
   


Hmm, I followed the instructions without doing any thinking beforehand. Such a beginnerīs mistake.  :dft002:
I shouldīve know better. Thereīs a rule saying not to use sudo with a gui app. But virt-manager is a gui app.

For what istīs worth the method described worked and my Debian vm could be imported and run.

BUT:

here are my questions:

- by having run
Code: [Select]
sudo virt-manager have I done something VERY stupid that cannot be set straight again?

- is there a way of finding out if something is amiss?

- havenīt got a clonezilla backup available yet, just a timeshift backup. So I could go back in time a few days if need be...
  for the root partition...

- ... but I would lose a lot of programmes I installed in the meantime.

Any ideas or suggestions of what I should do?

Many thanks for your help in advance.

Many greetings
Rosika  :wave
Title: Re: I did "sudo virt-manager"- help needed
Post by: firenice03 on January 20, 2023, 02:30:17 PM
@Rosika
you did exactly as admin would want...
Running a command/application with elevated access = sudo... -- I can' t think of why sudo w/ a GUI app would be an issue - one can launch a GUI with admin rights - same/same

As you didn't have permissions to run prior....

Now I'd look to confirm why adding the libvirt group didnt allow those permissions - perhaps not the correct group? may be the files (img) are owned by root..
Title: Re: I did "sudo virt-manager"- help needed
Post by: Rosika on January 21, 2023, 08:30:23 AM
@firenice03:

Thanks for your help.
Quote
I can' t think of why sudo w/ a GUI app would be an issue
Thatīs good to know.  :045:

Well, Debian in a virtual machine now works and it can be accessed by the vm.
The rights are thus now:
Code: [Select]
ll virtualdebian.img
-rw-r--r-- 1 32768 kvm 44G Jan 20 16:25 virtualdebian.img

Curious though:

somehow group isnīt displayed, it seems, just owner…  ???

Thanks a lot and many greetings.
Rosika  :wave

UPDATE:

I just noticed group and owner are displayed.
Couldnīt make sense of the 32768 entry, therefore the confusuion.