当前位置:网站首页>qemu and host share disk
qemu and host share disk
2022-08-10 06:14:00 【Liu Shigang】
Sometimes it is necessary to share files between the host and the qemu virtual machine, adding a shared disk will help with this.
Create a 64MB disk image file and format it as ext4 as a spare for shared disk.
dd if=/dev/zero of=ext4.img bs=512 count=131072mkfs.ext4 ext4.imgModify the qemu startup command and use -hdb to add a disk.
qemu-system-x86_64 -kernel ~/linux-4.14.191/arch/x86_64/boot/bzImage -hda ~/busybox-1.32.0/rootfs.img -append "root=/dev/sda console=ttyS0" -s -smp 1 -nographic -hdb ~/shadisk/ext4.imgAfter entering the qemu system, use the mount command to mount the sdb to the mnt directory.
Mount ext4.img in the original system to realize file sharing between qemu and the original system.
~/shadisk$ sudo mount -t ext4 -o loop ext4.img ./share边栏推荐
猜你喜欢
随机推荐
Unity中Xml简介以及通过脚本读取Xml文本中的内容
Myunity框架笔记2
电路分析中的电容器的基本知识
Flutter的生命周期
酸回收工艺原理
作为测试,常用的adb命令
21天学习挑战赛--补种胡杨求最大连续胡杨数量
动态规划、背包问题 6/28 121-124
为什么游戏需要热更新?
视差映射:更逼真的纹理细节表现(上):为什么要使用视差映射
21天学习挑战赛--字符串切割
计算数字区间中数字出现次数
动态规划、背包问题 6/24 106-110
常用模块封装-pymysql、pymongo(可优化)
Unity热更新哪些事
剑指 Offer(第 2 版)7/5 5-8
电池级碳酸锂除杂质钙镁离子工艺原理
【fiddler4】使用fiddler设置简单并发
Unity屏幕坐标转世界坐标,鼠标点击获取三维位置
剑指 Offer(第 2 版)7/7 14-17









