在宿主机上生成一个 disk device
dd if=/dev/zero of=/mnt/disk_device bs=100M count=1
格式化disk device
[root@tudou mnt]# mkfs.ext4 /mnt/disk_device
挂载disk device
[root@tudou mnt]# mkdir transfer && mount /mnt/disk_device /mnt/transfer/
挂载disk device
到KVM虚机
virsh attach-disk 虚拟机名称 /mnt/disk_device vdb
登录需要传输文件的虚拟机
mkdir /txt mount /dev/vdb /txt/
宿主机上直接解挂disk device
virsh detach-disk vm-82 /mnt/disk_device
标签:KVM,虚拟机,宿主机,mnt,device,disk From: https://www.cnblogs.com/libruce/p/17147543.html