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 '/')), 解壓縮后直接按照目錄結(jié)構(gòu)復(fù)制到”/”下.
下載 freedos.img.bz2 (FreeDOS disk image (modified version from the Bochs project)), 解壓后得到 freedos.img, 即可使用命令 qemu freedos.img 執(zhí)行:
同時(shí)也可以看到命令行中有警告信息:Could not open '/dev/kqemu' - QEMU acceleration layer not activated
說(shuō)明 kqemu 并沒(méi)有起作用.
接著就要安裝 kqemu 了, 首先安裝必要的開發(fā)環(huán)境:
......$ 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 進(jìn)行操作, 首先進(jìn)行編譯:
將壓縮文件解壓, 進(jìn)入解壓后的目錄, 依次執(zhí)行
./configure
make
sudo make install
此時(shí)已經(jīng)能夠看到 /dev/kqemu 了, 但是執(zhí)行 qemu 的時(shí)候還是報(bào)告 “Could not open '/dev/kqemu'
”, 于是重啟系統(tǒng), 發(fā)現(xiàn)重啟后 /dev/kqemu 就沒(méi)有了, 經(jīng)過(guò)仔細(xì)研究 kqemu-1.3.0pre9.tar.gz 中的
install.sh 文件, 發(fā)現(xiàn)可以這樣解決:
將 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
重新啟動(dòng) Ubuntu, 可以看到 /dev/kqemu, 執(zhí)行 qemu freedos.img
試驗(yàn)來(lái)一下, 果然沒(méi)有出現(xiàn) “Could not open '/dev/kqemu' ”, 在 qemu 的控制臺(tái)(可以在 qemu
界面上使用熱鍵 ctrl-alt-2 進(jìn)入, 通過(guò) “info kqemu” 命令驗(yàn)證了 kqemu 確實(shí)已經(jīng) enable 了:
建立一個(gè) 4G 的硬盤:
......$ qemu-img create -f qcow winxp.4G.img 4G
Formating 'winxp.4G.img', fmt=qcow, size=4194304 kB
使用 ISO 文件光盤啟動(dòng), 安裝 WinXP:
......$ qemu -cdrom DeepinXP-V4.iso -boot d -m 384 -net nic -net user winxp.4G.img
在運(yùn)行時(shí)可能會(huì)報(bào)告內(nèi)存不足:
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
啟動(dòng) WinXP 了:
QEMU 具有兩個(gè)選項(xiàng)控制 kqemu 加速器的行為, '-no-kqemu' 為不使用加速器, '-kernel-kqemu'
則是全加速模式, 如果這兩個(gè)選項(xiàng)都沒(méi)有, 那么就是只對(duì) user code 進(jìn)行加速, 而對(duì) guest kernel
還是使用動(dòng)態(tài)指令翻譯的模式運(yùn)行.
引用來(lái)自 http://fabrice.bellard.free.fr/qemu/kqemu-doc.html 的一段說(shuō)明:
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' 兩個(gè)模式下的虛擬機(jī)運(yùn)行速度, 區(qū)別還是很明顯的 :)
總結(jié)
以上是生活随笔為你收集整理的iso qemu 安装ubuntu_在 Ubuntu 6.06 上安装 qemu 和 kqemu(zz)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: shp设置utf8格式_shp文件格式说
- 下一篇: zeekooper集群搭建_Zookee