日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > Ubuntu >内容正文

Ubuntu

iso qemu 安装ubuntu_在 Ubuntu 6.06 上安装 qemu 和 kqemu(zz)

發布時間:2025/3/13 Ubuntu 65 豆豆
生活随笔 收集整理的這篇文章主要介紹了 iso qemu 安装ubuntu_在 Ubuntu 6.06 上安装 qemu 和 kqemu(zz) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

首先從 http://fabrice.bellard.free.fr/qemu/download.html 下載 qemu-0.8.1-i386.tar.gz (Binary distribution for linux-i386 (untar it in '/')), 解壓縮后直接按照目錄結構復制到”/”下.

下載 freedos.img.bz2 (FreeDOS disk image (modified version from the Bochs project)), 解壓后得到 freedos.img, 即可使用命令 qemu freedos.img 執行:

同時也可以看到命令行中有警告信息:Could not open '/dev/kqemu' - QEMU acceleration layer not activated

說明 kqemu 并沒有起作用.

接著就要安裝 kqemu 了, 首先安裝必要的開發環境:

......$ sudo apt-get install linux-headers-$(uname -r) build-essential gcc

我這邊是 linux-headers-2.6.15-26, gcc 的版本是 4.0.3 .

然后下載 kqemu-1.3.0pre9.tar.gz - New version with full virtualization support

按照其中的文檔 kqemu-doc.html 進行操作, 首先進行編譯:

將壓縮文件解壓, 進入解壓后的目錄, 依次執行

./configure

make

sudo make install

此時已經能夠看到 /dev/kqemu 了, 但是執行 qemu 的時候還是報告 “Could not open '/dev/kqemu'

”, 于是重啟系統, 發現重啟后 /dev/kqemu 就沒有了, 經過仔細研究 kqemu-1.3.0pre9.tar.gz 中的

install.sh 文件, 發現可以這樣解決:

將 install.sh 中的如下幾句話寫到 /etc/rc.local 中即可(注意要放在原有的最后一句“exit 0”之前):

# Create the kqemu device. No special priviledge is needed to use kqemu.

device="/dev/kqemu"

rm -f $device

mknod $device c 250 0

chmod 666 $device

然后在 rc.local 中再加上一句:

/sbin/modprobe kqemu

重新啟動 Ubuntu, 可以看到 /dev/kqemu, 執行 qemu freedos.img

試驗來一下, 果然沒有出現 “Could not open '/dev/kqemu' ”, 在 qemu 的控制臺(可以在 qemu

界面上使用熱鍵 ctrl-alt-2 進入, 通過 “info kqemu” 命令驗證了 kqemu 確實已經 enable 了:

建立一個 4G 的硬盤:

......$ qemu-img create -f qcow winxp.4G.img 4G

Formating 'winxp.4G.img', fmt=qcow, size=4194304 kB

使用 ISO 文件光盤啟動, 安裝 WinXP:

......$ qemu -cdrom DeepinXP-V4.iso -boot d -m 384 -net nic -net user winxp.4G.img

在運行時可能會報告內存不足:

You do not have enough space in '/dev/shm' for the 384 MB of QEMU virtual RAM.

To have more space available provided you have enough RAM and swap, do as root:

umount /dev/shm

mount -t tmpfs -o size=400m none /dev/shm

按照提示重新 mount /dev/shm 就可以了

安裝完畢后可以使用

......$ qemu -cdrom DeepinXP-V4.iso -boot c -m 256 -net nic -net user -kernel-kqemu winxp.4G.img

啟動 WinXP 了:

QEMU 具有兩個選項控制 kqemu 加速器的行為, '-no-kqemu' 為不使用加速器, '-kernel-kqemu'

則是全加速模式, 如果這兩個選項都沒有, 那么就是只對 user code 進行加速, 而對 guest kernel

還是使用動態指令翻譯的模式運行.

引用來自 http://fabrice.bellard.free.fr/qemu/kqemu-doc.html 的一段說明:

Full virtualization mode

This mode is activated with the '-kernel-kqemu' QEMU option. It is

currently only supported for 32 bit guest OSes (the x86_64 code is not

debugged yet). When KQEMU runs in full virtualization mode, both guest

kernel and user code are executed directly on the host CPU. In normal

mode, only the user code is executed directly and the kernel code is

still dynamically translated by QEMU.

The full virtualization mode cannot work with all OSes because it makes

some assumptions about the x86 instructions that the guest OS uses.

Note that even if some assumptions are made on the guest OS, the full

virtualization mode is secure by design: all the code is executed in

user mode on the host processor which means it cannot break the host OS.

The requirements for a guest OS to work in full virtualization mode are

very simple and most recent OSes (such as Linux or Windows 2000/XP)

fulfill them. Interested OS writers can contact the author to get the

necessary information to make their OS work in full virtualization mode

in QEMU.

比較了以下 '-no-kqemu' 和 '-kernel-kqemu' 兩個模式下的虛擬機運行速度, 區別還是很明顯的 :)

總結

以上是生活随笔為你收集整理的iso qemu 安装ubuntu_在 Ubuntu 6.06 上安装 qemu 和 kqemu(zz)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。