I'm having issues with a VM.
The VM was originally created under VMware and has worked fine for a while. Today when I booted it up instead of seeing the usual MATE login screen I get a login prompt:
f34-01-vm:
no matter what I enter, root or pgaltieri as login it never asks for password and immediately says login incorrect. While it's booting I see several [FAILED]... messages, e.g. [FAILED] to start CUPS Scheduler
I booted the system again and this time it dropped into emergency mode. In emergency mode I see the following messages in dmesg:
BTRFS info (device sda2): flagging fs with big metadata feature BTRFS info (device sda2): disk space caching is enabled BTRFS info (device sda2): has skinny extents BTRFS info (device sda2): start tree-log replay BTRFS info (device sda2): parent transid verify failed on 61849600 wanted 145639 fount 145637 BTRFS info (device sda2): parent transid verify failed on 61849600 wanted 145639 fount 145637 BTRFS: error (device sda2) in btrfs_replay_log:2423 errno=-5 IO failure (Failed to recover log tree) BTRFS error (device sda2) open_ctree failed
I ran btrfs check in emergency mode and it came up with a lot of errors.
How do i recover the partition(s) so I can boot the system, or at least mount them?
Also in emergency mode:
vi /run/initramfs/rdsosreport.txt
results in:
/usr/bin/vi: line 23: /usr/libexec/vi: No such file or directory
/usr/bin/vi is a script:
if test -f /usr/bin/vim then exec /usr/bin/vim "$@" fi
exec /usr/libexec/vi "$@"
neither /usr/bin/vim nor /usr/libexec/vi exist.
======================================================================================
I tried booting the vm under VirtualBox with the same result.
I converted the image:
qemu-img convert -O qcow ../VMware/VMs/f34-01-vm/f34-01-vm.vmdk f34-01-vm.qcow2
which worked without errors. I then ran virt-manager to try to boot the image. This fails with this error
Unable to complete install: 'internal error: process exited while connecting to monitor: 2022-03-18T19:13:15.196710Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2': Permission denied'
Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in cb_wrapper callback(asyncjob, *args, **kwargs) File "/usr/share/virt-manager/virtManager/createvm.py", line 2001, in _do_async_install installer.start_install(guest, meter=meter) File "/usr/share/virt-manager/virtinst/install/installer.py", line 701, in start_install domain = self._create_guest( File "/usr/share/virt-manager/virtinst/install/installer.py", line 649, in _create_guest domain = self.conn.createXML(install_xml or final_xml, 0) File "/usr/lib64/python3.9/site-packages/libvirt.py", line 4366, in createXML raise libvirtError('virDomainCreateXML() failed') libvirt.libvirtError: internal error: process exited while connecting to monitor: 2022-03-18T19:13:15.196710Z qemu-system-x86_64: -blockdev {"driver":"file","filename":"/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2': Permission denied
I added my user id to both the qemu and libvirt entries in /etc/group and logged out and logged back in and I get the same error. I also get SELinux alerts:
The first alert:
You need to change the label on f34-01-vm.qcow2' # semanage fcontext -a -t virt_image_t '/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2' # restorecon -v '/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2'
subsequent alerts tell me to run:
# /sbin/restorecon -v /run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2
I have run these commands, especially the restorecon, several times and I still get the alerts.
One thing the semanage command as shown fails with:
ValueError: File spec /run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2 conflicts with equivalency rule '/run /var/run'; Try adding '/var/run/media/pgaltieri/SDNVIRTLAB02/VirtualMachines/KVM/f34-01-vm.qcow2' instead
If I add the /var then it works.
here is the context of the file:
-rwxrwxrwx. 1 pgaltieri pgaltieri system_u:object_r:fusefs_t:s0 15041695744 Mar 18 11:46 f34-01-vm.qcow2*
So how the heck do I boot the image and get it running?
Paolo