mirror of
https://github.com/pikvm/pikvm.git
synced 2026-03-02 18:16:56 -05:00
Mass storage emulation / mounting issue #35
Labels
No labels
component:documentation
help wanted
resolution:delayed
resolution:duplicate
resolution:fixed
resolution:invalid
resolution:rejected
resolution:wontfix
success story
type:bug
type:bug
type:feature
type:question
type:question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/pikvm-pikvm#35
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tryallthethings on GitHub (Aug 15, 2020).
Originally assigned to: @mdevaev on GitHub.
I noticed two things while playing around with the mass storage mount feature.
When first connected to my computer pikvm provided a "Linux File-CD Gadget USB Device" device listed as a DVD/CD-Rom drive. After playing around with mounting / unmounting 2 images I disconnected the USB cable between pikvm and my computer. After reconnecting pikvm provided the same device name but the type changed from DVD drive to Disk drive. The drive mode will always be the last one I choose before disconnecting the USB cable but it never changes when I change the drive mode in pikvm.


The flash drive mode does not work at all with the two ISO images I tested. CD-ROM works with both images although the 4GB ISO won't show up (as expected) but at least Windows is detecting that something was "inserted" into the virtual drive and pops up an explorer window. I've tried swapping around the images and disk modes but flash doesn't work in any combination. I can see that something with the appropriate size was mounted but the filesystem is always RAW.

My PC is running Windows 8.1 and I'm using a RPi 4 2GB with the official pikvm image. USB connection is made through a USB2 splitter cable.
Edit: Doesn't work either with USB-C.
KVMD: 1.88
Streamer: 1.21 (ustreamer)
HAS_PDEATHSIG: Yes
WITH_GPIO: Yes
WITH_OMX: Yes
WITH_PTHREAD_NP: Yes
WITH_SETPROCTITLE: Yes
Linux kernel:
Machine: armv7l
Release: 5.4.51-2-ARCH
Version: #1 SMP PREEMPT Sat Aug 8 23:15:21 UTC 2020
Edit 2:
Images tested:
@tryallthethings commented on GitHub (Aug 15, 2020):
Similar behavior on my laptop (also running Windows 8.1). If the disk mode was flash when connected to the machine even the CD-ROM disk mode doesn't work until I disconnect and reconnect the pikvm.
@mdevaev commented on GitHub (Aug 15, 2020):
This is because you can't change the type of USB device that is already connected without actually disabling it. If we disable OTG to restart the device, we will also disable the keyboard. This is a limitation of libcomposite in the Linux kernel.
I believe this is a Windows issue. I have tested flash mode on the BIOS and on Linux and it works. I can't significantly affect the functionality of MSD since it is implemented by the standard kernel interface.
@tryallthethings commented on GitHub (Aug 15, 2020):
It was just something I observed. Trying to report things as detailed as possible. I couldn't care less about the device category as long as it works 😄
Not, not Windows exclusive. I did some more testing.
@tryallthethings commented on GitHub (Aug 15, 2020):
Here's a screenshot of the Kali Linux system with the Arch Linux ISO mounted. No idea why it identifies itself as Acronis media (/dev/sr0). Might be an artifact of a previous ISO I had mounted.

@mdevaev commented on GitHub (Aug 15, 2020):
If you change the emulation type, you must either reconnect the cable or restart the server.
You mean it's impossible to boot from it? You can't just switch the mode to a flash drive and load from it, your image must be prepared in a special way. For example, bootable ISO files for arch linux contain not only CD-ROM attributes, but also Flash. This is why they can be booted regardless of the type of media.
@tryallthethings commented on GitHub (Aug 16, 2020):
Good to know. A hint next to the switch would be great to inform about that. I wasn't aware of it.
Yes, it doesn't show up as a bootable device while the other images did. I just wanted the image contents to show up in the virtual drive for a first test. I only tested BIOS / Linux because you suggested that both worked for you. The images I've tested are all bootable so that can't be an issue.
Can you show me where in the code you create / change the cd-rom / flash devices so I can do some more research?
@mdevaev commented on GitHub (Aug 16, 2020):
Here the init (on rpi boot) code: https://github.com/pikvm/kvmd/blob/master/kvmd/apps/otg/init.py#L123
Here the api code: https://github.com/pikvm/kvmd/blob/master/kvmd/plugins/msd/otg/init.py#L273
@tryallthethings commented on GitHub (Dec 2, 2020):
I think this ticket can be closed.
The two takeaways here should be
@mdevaev commented on GitHub (Dec 2, 2020):
🤣
The second should also be solved by restarting the server. My experience shows this. Could you confirm this too?
As far as I can tell right now, this problem doesn't have a software solution. In v3, there is a USB breaker circuit for this.
@tryallthethings commented on GitHub (Dec 4, 2020):
I've just tried it. Rebooting the server works for me too. I suppose because during POST the USB-connection is severed for a moment.