You are not logged in.

#1 2020-03-19 19:55:38

Klenn
Member
Registered: 2020-03-19
Posts: 3

Arch installation in QEMU: Mount is emptying files.

Hi,

i am testing out my Arch installation script in a QEMU VM running in virt-manager.
The script is tranfered via a USB using the redirection feature.

Almost always some files will show up as empty after mounting the USB /dev/sdX1 to the created directory /usb.
When i inspect them from my host system they confirm to be empty.

After repartitioning the drive multiple times, rebooting the host and guest system and replacing the empty files the problem solves itself.
It also appears random which steps exactly lead to the files showing up correctly.

I have tested multiple scenarios with no definite success.

- Host: Reboot
- USB: Reformat to same file system: ext4
    - USB: Recopy files
- Host: Reformat to different file system: Btrfs
- USB: Adding to VM before boot
- USB: Adding to VM after boot
- Host: Different Hardware and Arch installation
- Different USB-Stick
- New UUID: Btrfs
- New Partition Table: Btrfs -> Btrfs


Has anyone encountered a similar problem or an idea what is going on?


Thanks for your help,

Klenn

Offline

#2 2020-03-20 14:02:42

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,805

Re: Arch installation in QEMU: Mount is emptying files.

The script is tranfered via a USB using the redirection feature.

Are you using https://wiki.archlinux.org/index.php/QE … with_SPICE ?

Do the problems also occur if you follow https://wiki.archlinux.org/index.php/QE … USB_device ?


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#3 2020-03-21 10:23:33

Klenn
Member
Registered: 2020-03-19
Posts: 3

Re: Arch installation in QEMU: Mount is emptying files.

Yes i am using SPICE, the USB controller aswell as the SPICE redirection channel show up in virt-manager, so adding QEMU commands manually probably wont be necessary.

This seems analogous to the USB 3 config in the SPICE docs: https://www.spice-space.org/usbredir.html

<controller type="usb" index="0" model="qemu-xhci" ports="15">
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
</controller>

<redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="2"/>
    </redirdev>
<redirdev bus="usb" type="spicevmc">
      <address type="usb" bus="0" port="3"/>
</redirdev>

If i try to pass through the USB directly via these settings in virt-manager:

<hostdev mode="subsystem" type="usb" managed="yes">
  <source>
    <vendor id="0xffff"/>
    <product id="0x5678"/>
  </source>
  <address type="usb" bus="0" port="4"/>
</hostdev>

The system wont boot with these errors:

Error starting domain: internal error: process exited while connecting to monitor: 2020-03-21T10:12:06.606107Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-vid [bit 9]
2020-03-21T10:12:06.606114Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48DH).vmx-posted-intr [bit 7]
2020-03-21T10:12:06.606121Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-03-21T10:12:06.606127Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/003/007: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
2020-03-21T10:12:06.669609Z qemu-system-x86_64: -device usb-host,hostbus=3,hostaddr=7,id=hostdev0,bus=usb.0,port=4: failed to open host usb device 3:7

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/object/domain.py", line 1279, in startup
    self._backend.create()
  File "/usr/lib/python3.8/site-packages/libvirt.py", line 1136, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: internal error: process exited while connecting to monitor: 2020-03-21T10:12:06.606107Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48BH).vmx-apicv-vid [bit 9]
2020-03-21T10:12:06.606114Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48DH).vmx-posted-intr [bit 7]
2020-03-21T10:12:06.606121Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(48FH).vmx-exit-load-perf-global-ctrl [bit 12]
2020-03-21T10:12:06.606127Z qemu-system-x86_64: warning: host doesn't support requested feature: MSR(490H).vmx-entry-load-perf-global-ctrl [bit 13]
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/003/007: Permission denied
libusb: error [_get_usbfs_fd] libusb requires write access to USB device nodes.
2020-03-21T10:12:06.669609Z qemu-system-x86_64: -device usb-host,hostbus=3,hostaddr=7,id=hostdev0,bus=usb.0,port=4: failed to open host usb device 3:7

Offline

#4 2020-03-21 13:49:38

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 7,805

Re: Arch installation in QEMU: Mount is emptying files.

the USB controller aswell as the SPICE redirection channel show up in virt-manager, so adding QEMU commands manually probably wont be necessary.

Although the problem description suggests there's an error using spice libraries, keep in mind libvirt is only a frontend.
Many threads on this forum that started out claiming qemu problems turned out to be libvirt problems.


The errors look like they have to do with permission restrictions , check the purple note on the wiki.


Multi-init booting with apg Openrc and systemd coexisting
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them

Offline

#5 2020-03-24 13:21:31

Klenn
Member
Registered: 2020-03-19
Posts: 3

Re: Arch installation in QEMU: Mount is emptying files.

Quick update: I tried to mount a USB with my script on a physical machine.

The problem still persists, it might be that the script sometimes does not mount the harddisk correctly and overrides the filesystem structure.
I worked around it by recloning the lost files with git. I have to uninstall git afterwards due to storage problems but it works.

Offline

Board footer

Powered by FluxBB