官方:https://wiki.minix3.org/doku.php?id=usersguide:runningonqemu

Running on QEMU and KVM

This page describes the process of installing Minix 3 on QEMU and KVM. If you run into problems, see the workarounds section at the bottom of the page for possible solutions.

Preliminaries

Please install QEMU or KVM. QEMU and KVM sources can be downloaded from their websites. If you're running a Linux distribution, you can install QEMU and KVM via the package manager.

Virtual Machine Setup

Before you install Minix, you will need to create a new virtual machine configuration. The VM configuration specifies the parameters of your Virtual machine, e.g., how much memory you want the VM to use, how big you want the virtual hard disk to be, etc.

Open a terminal, change directory to where you want to create the Hard Disk Image, and write:

# qemu-img create minix.img 8G

This will create an 8 GB hard disk image named minix.img, which we will use to install the operating system.

Installation

Assuming you have downloaded and decompressed a Minix ISO image from the download page, you can mount the ISO file:

# qemu -localtime -net user -net nic -m 256 -cdrom minix.iso -hda minix.img -boot d

or

# kvm -localtime -net user -net nic -m 256 -cdrom minix.iso -hda minix.img -boot d

where minix.iso is the .iso we downloaded earlier (which is mounted as CD-ROM), minix.img is the disk image we created, and 256 is the amount of memory dedicated to the Virtual Machine. The option -boot d makes sure that we boot from the CD-ROM.

With QEMU 2.0.0 the command line shall look like this:

# qemu-system-x86_64 -localtime -net user -net nic -m 256 -cdrom minix.iso -hda minix.img -boot d

Then you can follow the normal installation instructions. If you only get a blank screen or QEMU seems stuck with the “SeaBIOS” message, try adding the -sdl parameter.

When the installation is over, type

shutdown -h now

to exit Minix.

When you get the cd>, type off in order to shutdown the Virtual Machine.

Booting MINIX 3

Now you have installed Minix 3 in the virtual machine. To boot Minix from the virtual disk image, type:

If your computer stores the system time (real time clock) in local time, e.g. Windows XP default, then:

# qemu -localtime -net user -net nic -m 256 -hda minix.img

OR

If your computer stores the system time (real time clock) in UTC, e.g. Debian GNU/Linux default, then:

# qemu -rtc base=utc -net user -net nic -m 256 -hda minix.img

Using the virtualized disk and network driver

Minix mainline contains virtualized disk and network drivers. So you have to have the latest minix built.

To use the virtualized disk driver, add a boot option to /etc/boot.cfg.local with virtio_blk=yes added to the boot parameters. Example:

menu=Start MINIX 3 latest serial virtio:load_mods /boot/minix_latest/mod*;multiboot /boot/minix_latest/kernel rootdevname=$rootdevname $args cttyline=0 virtio_blk=yes

then update /boot.cfg (by rebuilding everything, just make hdboot or just /bin/update_bootcfg), shutdown, and restart kvm with -drive file=imgfile,if=virtio for its disk image. Example:

# kvm -net nic -net user -drive file=/dev/sda,if=virtio -serial stdio -m 1300

Then boot with your new virtio boot option.

To use the virtualized network driver, minix first has to try to use it. Run netconf:

# netconf
[..]
11.   Virtio network device
[..]
Ethernet card? [..] 11Configure network using DHCP or manually?1. Automatically using DHCP
2. ManuallyConfigure method? [1]
Backed up /etc/inet.conf to /etc/inet.conf~
Backed up /usr/etc/rc.local to /usr/etc/rc.local~You might have to reboot for the changes to take effect.

Then shutdown, and restart kvm with the -net nic,model=virtio parameter. Example:

# kvm -net nic,model=virtio -net user -drive file=imgfile,if=virtio -serial stdio -m 1300

Post-install Configuration

You should read Post Installation for some configuration tips.

Login with SSH

Make sure you have openssh installed and running on MINIX. You can install openssh with pkgin (as detailed in the Post Installationdocument).

Unfortunately the -net user option doesn't allow the host system to connect to MINIX. One could use -net tap, but this is messy (especially when the host has a wireless connection) and it is generally not worth the effort for something this simple.

A simple solution is to forward the listening ssh port on MINIX to a port on the host system. This can be done by replacing the -net useroption with -net user,hostfwd=tcp::10022-:22, which forwards port 22 (SSH) on MINIX to port 10022 on the host. The command to boot MINIX will then become something like this (also works with virtio):

# qemu -localtime -net user,hostfwd=tcp::10022-:22 -net nic -m 256 -hda minix.img

You can now connect to MINIX with:

$ ssh root@localhost -p10022

Workarounds

core system service died (tty) / kernel panic

A couple of users have reported a panic during the boot on Gentoo/amd64 hosts (qemu 1.5.3). This is an example of the error message:

tty           5 0x8048359 0x804868b 0x8048732 0x80490ea 0x804920b 0x804d4c8 0x804d6ce 0x804df26 0x8048196 0x80480a7
TTY: not initializing rs232 line 0 (in use by kernel)
do_irqctl: IRQ check failed for proc 5, IRQ 3
RS232: Couldn't obtain hook for irq 3
do_irqctl: IRQ check failed for proc 5, IRQ 4
RS232: Couldn't obtain hook for irq 4
do_irqctl: IRQ check failed for proc 5, IRQ 3
RS232: Couldn't obtain hook for irq 3
do_irqctl: IRQ check failed for proc 5, IRQ 1
tty(5): panic: Couldn't set keyboard IRQ policy: -1
syslib:panic.c: stacktrace: 0x8050721 0x804b39a 0x804c9e3 0x804ff6b 0x8050039 0x805024e 0x804d9b3 0x8048196 0x80480a7
core system service died: service 'tty'*+(slot 6, ep 5, pid 10)
rs            2 0xf1001364 0x8050f77 0x8050d34 0x8050aeb 0x8050b2f 0x804d304 0x80488c9 0x804ffef 0x8050a58 0x80493c3 0x8048196 0x80480a7
kernel panic: cause_sig: sig manager 2 gets lethal signal 6 for itself
kernel on CPU 0: 0xf0429c6f 0xf0429723 0xf042a4c4 0xf0428ee2 0xf0429889 0xf0419d05 

The workaround is to add -cpu kvm32 to the command used to invoke qemu:

qemu-kvm -localtime -cpu kvm32 -net user,hostfwd=tcp::10022-:22 -net nic -m 256 -hda minix.img

QEMU 0.14.1

QEMU 0.14.1 is known to have issues with rebooting; it appears as if the boot menu is frozen. This problem is fixed in at least version 1.0.50, but maybe also in earlier versions.

You can compile the newest version from git on Ubuntu as follows:

$ sudo apt-get update
$ sudo apt-get install git build-essential libsdl-dev libglib2.0-0 libglib2.0-dev zlib1g-dev
$ git clone git://git.qemu.org/qemu.git qemu
$ cd qemu
$ ./configure --target-list=x86_64-softmmu --enable-sdl --enable-kvm
$ make
$ sudo make install

QEMU will be installed in /usr/local/bin/qemu-system-x86_64.

Copy and Paste between host and guest

I do not know how to directly copy and paste between the host operating system and the guest operating system, but there is a workaround: ssh. Run the following on Minix to install ssh:

# pkgin install openssh
# reboot

then start qemu with the option -net hostfwd=tcp::2022-:22 as in

qemu -rtc base=utc -net user,hostfwd=tcp::2022-:22 -net nic -m 512 -hda minix.img -no-reboot &

Now you can run, from your host,

ssh -p 2022 root@localhost

from an xterm or console and use the scrollback buffer and copy and paste.

qemu运行minix相关推荐

  1. 自动搭建openEuler虚拟机QEMU运行环境

    本文介绍了一个自动搭建openEuler虚拟机QEMU运行环境的脚本使用方法,本脚本能下载并安装各种依赖项,自动下载并编译安装QEMU 4.1.1和busybox 1.25.1,下载并安装对Linux ...

  2. UEFI开发历程1—edk2开发环境的搭建以及在虚拟机QEMU运行OVMF固件

    一.开发工具准备(下面是开发环境搭建部分) 1.下载Visual Studio,打开Visual Studio Installer,选择Comunity版本,工作负载的选择如图1-1所示,安装. 图1 ...

  3. 0.使用Qemu运行OP-TEE

    历经一年多时间的系统整理合补充,<手机安全和可信应用开发指南:TrustZone与OP-TEE技术详解 >一书得以出版,书中详细介绍了TEE以及系统安全中的所有内容,全书按照从硬件到软件, ...

  4. armv8运行linux,ARMv8-A QEMU运行OP-TEE/ATF环境搭建

    关键词:OP-TEE.ATF.xtest.Linux等等. 下面记录通过ARMv8-A QEMU运行OP-TEE.ARM Trusted Firmware.Linux环境搭建过程. 1. 编译环境准备 ...

  5. 调试QEMU运行xv6时黑框闪烁问题的过程

    前言 最近一段时间终于有了连续的空闲,重新拿起xv6,复习os内容,同时记录一下一个bug的调试经历. 问题 在看过xv6和类似os的相关文章后,我开始自己动手写一个minios.发现,在笔记本电脑上 ...

  6. optee介绍(一)代码下载编译以及使用qemu运行

    系列文章目录 第一章 optee介绍(一)代码下载与编译 第二章 optee介绍(二)qemu run-only运行 文章目录 系列文章目录 前言 一.optee代码下载 1.repo方式下载 2.手 ...

  7. 龙芯3A使用qemu运行MegaCli配置raid卡

    raid卡功能配置(完善中) 问题如下: 在龙芯3a双路板子上无法支持raid卡的配置,即无法在开机启动的时候像x86下机器那样,通过按ctrl+H来配置LSI raid卡的level(只要求raid ...

  8. qemu运行虚拟机无反应,只输出一行提示信息:VNC server running on 127.0.0.1:5900

    1.问题发生 当安装完qemu后,尝试运行一个虚拟机,结果没有运行起来,只有一行提示"VNC server running on 127.0.0.1:5900". 通过浏览网上的解 ...

  9. qemu运行riscv64 linux

    使用qemu运行riscv64 linux 本文使用qemu运行riscv64 linux旨在与真实硬件板保持一致,因此不使用qemu提供的任何直接加载elf文件的方式启动,而是从头到尾均加载原始的b ...

最新文章

  1. 解决Aireplay-ng信道问题
  2. 《Dream(梦想)》,无力的我,想放弃的我,深深的问自己,什么是梦想!!!
  3. oracle的视图表,oracle 常用视图和表
  4. 父路径_Logtail 新功能:采集路径黑名单
  5. kkt条件的matlab仿真,请教关于SVM中KKT条件的推导
  6. 一份北大信科内部流传的 “CS 自救指南”
  7. 【BZOJ2588】Count on a tree,主席树维护链+ST表求LCA
  8. Bootstrap table分页问题汇总
  9. VMware vSphere 5.x 与 vSphere 6.0各版本功能特性对比
  10. APUE学习笔记——信号
  11. 免费图片文字识别,非常好用
  12. java加载不了驱动程序,请教java连mysql数据库时一直加载不起驱动
  13. steam for linux 安装目录,我该如何安装Steam?
  14. 微信 公众号 JS接口安全域名 是啥 什么意思
  15. Qt Quick事件处理之鼠标 键盘 定时器
  16. 应用计算机怎么弹ink,Win7系统打开计算机管理提示computer management.Ink的解决方法教程[多图]...
  17. 程序员读《三体》后看到了什么?
  18. 关于客户端下载文件而不是在服务器生成文件
  19. IBM待遇完全揭密--工资 级别等(最强完整版)
  20. 十二月英语总结--充满热情

热门文章

  1. 引发的异常: 0xC0000005: 写入位置 0x0000000000000030 时发生访问冲突。
  2. @Modifying注解误用错误
  3. bug日志:报错 java:程序包javax.persistence.criteria不存在,解决!
  4. 什么是分享经济?大众创业时代,最能赚钱的商业模式
  5. 解析:共享经济新模式,共享网红平台的新趋势
  6. TeX Live + Texmaker
  7. 计算机硬盘改造u盘,怎样把台式电脑硬盘变成U盘??
  8. 数据库中三种范式的讲解
  9. 【FAQ】接入华为应用内支付服务常见问题解答
  10. php taint扩展,检测XSS漏洞的扩展 PHP Taint