当前位置:网站首页>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
边栏推荐
- lua小工具-保留指定位数的小数
- C陷阱与缺陷 个人阅读笔记
- Share a professional TA's "Shader Reference"
- Explore the origin of the garbled problem: the association between GBK, UTF8, UTF16, UTF8BOM, and ASN1
- unity守则(随时持续更新\自我总结)
- Easy to master Unity of eight prior to rendering
- AR Foundation Editor Remote插件使用方法
- 每日刷题(day02)——leetcode 622. 设计循环队列
- Unity插件DOTween使用指南2(简释贝塞尔曲线)
- Unity中实现Animation Clip动画片段的倒播(该案例可以防止动画延迟)
猜你喜欢
随机推荐
优先级队列,大小顶堆PriorityQueue
每日刷题(day01)——leetcode 53. 最大子数组和
lua循环
优化Mysql运行OrderBy性能
钴镍回收树脂的工艺原理
三种素数筛总结——(朴素筛,埃氏筛,线性筛)
Flutter Package 插件开发
STM32单片机OLED经典2048游戏单片机小游戏
AR Foundation Editor Remote插件使用方法
为什么游戏需要热更新
How to implement a grid construction system
clickhouse出现数据重复问题
手把手教你改内核源码--sysfs虚拟文件系统1
样条曲线(下)之插值问题(贝塞尔曲线、B样条和一般样条曲线插值)
内核性能分析总结
酸阻滞树脂
Explore the origin of the garbled problem: the association between GBK, UTF8, UTF16, UTF8BOM, and ASN1
【C语言】结构体变量学习笔记1
手把手教你改内核源码--sysfs虚拟文件系统2
氨氮吸附材料原理