当前位置:网站首页>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.img
Modify 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.img
After 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
边栏推荐
猜你喜欢
以STM32F103C6TA为例通过配置CubeMX实现GPIO输出完成点灯实例
51单片机智能远程遥控温控PWM电风扇系统红外遥控温度速度定时关机
STM32单片机手机APP蓝牙高亮RGB彩灯控制板任意颜色亮度调光
浅谈游戏中3种常用阴影渲染技术(2):阴影锥
通过配置CubeMX的TIMER的PWM初始化实现硬件PWM呼吸灯闪烁
从零开始构建Google Protocol Buffer / protobuf 的helloworld工程(超级详细)
STM32F407ZG PWM
51单片机室内环境甲醛PM2.5光照温度湿度检测及窗帘加湿消毒控制系统
Unity中Xml简介以及通过脚本读取Xml文本中的内容
GC0053-STM32单片机NTC热敏电阻温度采集及控制LCD1602
随机推荐
作为测试,常用的adb命令
链表、栈、队列
【fiddler3】使用fiddler设置弱网模式
手把手教你改内核源码--sysfs虚拟文件系统2
每日刷题(day03)——leetcode 899. 有序队列
序列化、编码、requests库json和data参数
51单片机ST188手持人体温度脉搏心率测量仪锂电池充电
浅谈《帧同步网络游戏》之“框架”实现思路
markdown类图学习
GC0053-STM32单片机NTC热敏电阻温度采集及控制LCD1602
STM32F407ZG GPIO输出相关实验
从零开始构建Google Protocol Buffer / protobuf 的helloworld工程(超级详细)
最简单的字符设备驱动
Unity中实现Animation Clip动画片段的倒播(该案例可以防止动画延迟)
过大数组导致爆栈的解决方法记录(堆栈)
Unity屏幕坐标转世界坐标,鼠标点击获取三维位置
ASP.NET有关于文件上传、下载、全选、删除选中重要干货(亲测有效)
动态规划、背包问题 6/25 110-115
Tkinter 模块学习
LaTeX总结----在CSDN上写出数学公式