qemu 在当前OS中运行其它的操作系统
来源:互联网 发布:笔记本怎么样卸载软件 编辑:程序博客网 时间:2024/06/07 03:33
qemu从某种意义上功能类似于vmware/virtual box之类的软件,可以让你在当前OS中运行其它的操作系统,但是这仅仅是qemu的一种功能
qemu还可以模拟不同的cpu架构下的系统,比如在普通的个人pc上运行 arm linux之类,这个vmware之类的可能没有
关于qemu的使用
先到官网上下载qemu的源代码,目前是 1.2,如果使用的是linux系统,这个好办,直接编译安装,网上有不少说明的文档
使用的过程一般分为三步
1. 创建虚拟机文件系统
qemu-img create /f qcow2 xxx.img 10G
2. 在虚拟机文件系统中安装操作系统
qemu-system-i386 -hda xxx.img -cdrom xxx.iso -boot d 以xxx.img为文件系统,xxx.iso是系统安装ISO文件
3. 运行安装好的操作系统
qemu-system-i386 -hda xxx.img 运行xxx.img中的系统
以上的命令参数都比较简单,实际使用中需根据具体情况自己配置创建一个虚拟硬盘 $ qemu-img create -f qcow hda.img 10G 创建文件系统 sudo dd if=/dev/zero of=rootfs.img bs=1M count=100 sudo mkfs.ext2 -N 512 rootfs.img 安装Linux系统 $ qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.18-6-versatile -initrd initrd.gz -hda hda.img -append "root=/dev/ram" 运行Linux系统 $ qemu-system-arm -M versatilepb -kernel vmlinuz-2.6.18-6-versatile -initrd initrd.img-2.6.18-6-versatile -hda hda.img -append "root=/dev/sda1" qemu-system-arm -kernel zImage.integrator -initrd arm_root.img -nographic -append "console=ttyAMA0" qemu-system-arm -kernel <path to the kernel image>/zImage-<kernel version>-qemu-arm -initrd ususe.img -nographic -append console=ttyAMA0 Framebuffer console: qemu-system-arm -kernel <path to the kernel image>/zImage-<kernel version>-qemu-arm -initrd ususe.img -append console=tty1
Creating a hard disk image
If you are using FILO, you must create a hard disk image containing the Linux kernel and optional initramfs that FILO loads.
Whether or not you use FILO, you may also wish to populate the disk image with the root filesystem of whatever Linux distribution you want to run.
Create an empty disk image:
$ qemu-img create -f raw disk.img 200M
Format it:
$ mkfs.ext2 -F disk.img
The remaining steps must be performed as root. Create a temporary mountpoint and mount the image:
# mkdir /mnt/rootfs# mount -o loop disk.img /mnt/rootfs
Create a boot directory and copy your Linux kernel (vmlinuz) and initramfs (initrd) to it:
# mkdir /mnt/rootfs/boot# cp vmlinuz /mnt/rootfs/boot/vmlinuz# cp initrd /mnt/rootfs/boot/initrd
At this point, you can also copy a complete root filesystem to the disk image.
# cp -R /* /mnt/rootfs
Alternatively, with Debian you can use the debootstrap command to create a basic root filesystem:
# debootstrap --arch i386 sarge /mnt/rootfs http://ftp.debian.org/debian/
If you are using a debootstrap filesystem, open the file /mnt/rootfs/etc/inittab and change runlevel to level 1:
id:1:initdefault:
cd out of /mnt/rootfs and umount it:
# umount /mnt/rootfs
Exit from the root account:
# exit
Starting coreboot in QEMU
Execute QEMU using the following parameters:
$ qemu -bios path/to/coreboot.rom -hda disk.img -nographic
- qemu 在当前OS中运行其它的操作系统
- 在qemu中运行magenta
- 在当前Activity中finish掉其它Activity的方法
- 在Ubuntu下基于QEMU运行XINU OS x86系统
- 在qemu的beagleboard上运行android
- 内核虚拟化KVM/QEMU——guest os,qemu,kvm的运行流程
- 在程序运行中中止当前方法的运行
- qemu中运行图形界面
- 在用作DomU运行的simple OS中…
- 使用Qemu在Windows 7中运行LiveAndroid0.3
- 如何在Ubuntu中利用Qemu运行BeagleBoard firmware
- 在qemu中运行wince 5.0/6.0(1)
- 在qemu中运行wince 5.0/6.0(2)
- linux + busybox编译以及在qemu中运行
- 在Java程序中获取当前运行程序的路径
- 在Java程序中获取当前运行程序的路径
- 提升当前用户在MOSS中代码的运行权限
- 在QEMU上运行vxworks
- JAVA适配器实例讲解
- Android Application类注意事项
- GeoServer中一个shape发布多个图层时出现调用空白的问题及解决办法
- 捕捉键盘中断消息
- 一些有趣的网站
- qemu 在当前OS中运行其它的操作系统
- 常用ANSI控制码表
- Java线程池使用说明【比较全面】
- iOS开发中属性最常用的关键字及其定义
- 关于JKAlertDialog在多个视图控制器跳转后不能正常显示的问题的解决--IOS
- Map类集
- Spring整合JMS(三)——MessageConverter介绍
- 视频合并问题
- ORACLE逻辑备份实现数据库迁移遇到的问题