Open z5241248 opened 1 month ago
Do you have a good way to transfer files without using the cloud?
Have you found a way to do it?
Do you have a good way to transfer files without using the cloud?
Have you found a way to do it?
First, please forgive me if there are some mistakes in my grammar
I found a way to make it work. Still mount external folder.
You can mount a shared folder like following content. Add the command when the Qemu starts:
qemu-system-x86_64 … -virtfs local,path=/mnt/shared,mount_tag=host0,security_model=passthrough,id=host0
And then, you should create a new folder in the system:
mkdir -p /mnt/shared mount -t 9p -o trans=virtio,version=9p2000.L host0 /mnt/shared
I tried to using Samba, it works.
You can refer this link, it's from Qemu official: https://www.qemu.org/docs/master/system/invocation.html#hxtool-5
First, you should install the Samba server in your host system.
And then, add the command when the Qemu starts:
-nic user,id=nic0,smb=/share_directory
There is a example
qemu-system-x86_64 -name win7-Lite-1 -m 2048M -smp cpus=1,sockets=1 -enable-kvm -machine smm=off -boot order=c -drive file=/data/gns3/data/GNS3/images/QEMU/win7-Lite.qcow2 -vnc 0.0.0.0:2 -nic user,id=nic0,smb=/opt -machine usb=on -device usb-tablet
When you start your Windows Qemu system, you should check your ip address.
And then, adding a Network mapping.
Samba uses the x.x.x.4 address by default, the qemu official document also mention it.
If it succeeds, a new hard drive will appear.
For Docker, we can use the command "docker cp" to transfer files to a container. But for QEMU, how do we do it without using the cloud?
I tried using a shared folder (mount -t 9p…), but it's not the best way because I need to execute the command to mount the shared folder in the QEMU system every time it starts. Furthermore, mounting a shared folder doesn't seem to work with Windows systems.
Do you have a good way to transfer files without using the cloud?