amluto / virtme

An easy way to virtualize the running system
GNU General Public License v2.0
330 stars 66 forks source link

9p: Multiple devices detected in same VirtFS export #60

Closed lmb closed 4 years ago

lmb commented 4 years ago

On ubuntu 20.04 I get the following when booting a 5.7 kernel on QEMU:

qemu-system-x86_64: warning: 9p: Multiple devices detected in same VirtFS export, which might lead to file ID collisions and severe misbehaviours on guest! You should either use a separate export for each device shared from host or use virtfs option 'multidevs=remap'!
$ qemu-system-x86_64 --version
QEMU emulator version 4.2.0 (Debian 1:4.2-3ubuntu6.1)
Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers

Sounds straight forward enough, however I'm not sure what the more backwards compatible approach is. Separate exports?

tohojo commented 4 years ago

Ran into this as well; the error doesn't seem to matter much(?), but seems straight-forward to fix?

lmb commented 4 years ago

I looked into it for a bit, but couldn't figure it out! Do you have any pointers?

tohojo commented 4 years ago

Just adding 'multidevs=remap' to the end of the -fsdev args in export_virtfs() in commands/run.py seems to do the trick for me...

amluto commented 4 years ago

I don't think separate exports is practical -- if we're exporting /, we're going to hit this, and I don't think it makes sense to try to manually recreate the entire host mount hierarchy using separate exports.

amluto commented 4 years ago

Oddly, I was unable to reproduce the warning, but I think this is now fixed about as well as it can be. Please comment or reopen if any of you still have issues or think it's possible to do better.