Hello everyone,
I'm very new to
Qemu and currently running the emulator for arm64 platform. I'm trying
to share/copy a folder from my host system onto Qemu , but haven't
succeeded yet. I have tried quite a few ways
1 Mount a host folder using 9p over virtio
Kernel configuration options were verfied to ensure 9p options are enabled.
Ran the emulator using :
qemu-system-aarch64
-M virt -cpu cortex-a57 -kernel Image -initrd rootfs.img.gz -nographic
-append "console=ttyAMA0 root=/dev/ram rootfstype=ramfs init=/bin/sh"
-snapshot -fsdev local,security_model=none,id=fsdev0,path=/mnt/shared -device virtio-9p-pci,id=fs0,fsdev=fsdev0,mount_tag=hostshare
And tried mounting using
mount -t 9p -o trans=virtio,version=9p2000.L hostshare /tmp/share
But the console showed ;
9pnet_virtio : No channels available
mount: mounting hostshare on /tmp/share/ failed: No such file or directory
a) I verfied that /tmp/share is present .
b) Tried using -virtfs option with qemu-system-aarch64 , but it showed the same logs.
2
Created a plain binary image using qemu-img ( raw format ). Formatted
it as ext4. Mounted it on the host , copied the required folder into the
mount point and then unmounted it . Now I tried inserting the image
using;
qemu-system-aarch64 -M virt -cpu cortex-a57 -kernel Image -initrd
rootfs.img.gz -nographic -append "console=ttyAMA0 root=/dev/ram
rootfstype=ramfs init=/bin/sh" -snapshot -drive /home/user/Documents/image_file
Also using
qemu-system-aarch64 -M virt -cpu cortex-a57 -kernel Image -initrd
rootfs.img.gz -nographic -append "console=ttyAMA0 root=/dev/ram
rootfstype=ramfs init=/bin/sh" -snapshot -hdd /home/user/Documents/image_file
But on my guest , I couldn't locate any mount point for the image
3 Sharing through host USB device
Added the usb device using the usb_add monitor command . But the
device wasn't detected/mounted in Qemu ( lsusb and mount didn't show any
USB
device )
4 Added the folder to initrd image ( rootfs.img.gz)
In this method , emulator didn't start , supposedly due to
exceeding size limit of 16M ( new image was found to be around 160M ).
As
I had mentioned in the beginning , I'm very new to this and couldn't
actually figure the proper way to resolve these issues.. Any help would
be appreciated.
Regards,
Jayadev