一直想好好学习一下操做系统课程,去一个Mooc网站上找了一门操做系统的课程。这即是里面的配套实验。
实验指导:点这里html
lab0主要是准备相关的操做环境。课程推荐使用qemu
做为硬件模拟器,推荐运行环境为linux操做系统。
由于我使用的是Windows系统,因此须要解决运行环境的问题。开始想了几种解决方案:一个是直接装一个Linux的操做系统,可是以为这样子系统切换太麻烦了;一个是租一台云服务器,在网上看了一下感受国内都略贵的样子;还有就是本身装一个虚拟机了,虽然这样子可能有时候性能会有点慢。
另外,在网上看到有个叫作"实验楼"的网站,上面有这门课的配套实验。网站会给你分配和布置实验设备。在上面用过几回,以为每次都会从新分配机器,不是很方便。还有就是毕竟是别人布置的环境,总有种不自由的感受。对于我这种新手若是碰到莫名其妙的问题,而解决方案要改权限什么的话,就懵逼了。
因此,我最终仍是选择了在虚拟机上装一个Ubuntu。linux
虚拟机通常有两种选择:一个是VMWare Workstation,另外一个是Virtual Box。我选择了VBox,由于这个是免费的。git
Virtaul Box的安装过程按照默认的选项就行了,没有什么特别之处。ubuntu
安装好之后,在VBox里面新建一个Ubuntu的设备就行了。我使用的虚拟设备配置以下:windows
内存: 1GB
硬盘:10GB (原本Vbox建议的是8GB,可是后来安装系统的时候至少要8G空间来访系统配置,而后我就给了10G)服务器
而后点击"运行"的时候,说须要读启动盘。到网上搜了一下,说要下一个镜像放进去。
因而,我去下了一个镜像,用虚拟光驱读出来。
接下来的过程,就是像给正常机器装系统同样,在虚拟设备上装了一个Ubuntu系统,装好之后就再也不须要启动盘了。工具
为了方便和虚拟机之间传输数据,在虚拟设备里面挂载了一个共享盘。具体细节能够参考这里性能
Virtaul Box下载地址:https://www.virtualbox.org/wiki/Downloads
Ubuntu下载地址(选Desktop就行了):https://www.ubuntu.com/download学习
去官网上下了一个压缩包。打开发现是源码。因而上网搜了一下,安装的过程大约是下面这样子。测试
cd /qemu-xxxx ./configure sudo make sudo make install
在make 时出现了如下错误:
GEN aarch64-softmmu/config-devices.mak.tmp GEN aarch64-softmmu/config-devices.mak GEN alpha-softmmu/config-devices.mak.tmp GEN alpha-softmmu/config-devices.mak GEN arm-softmmu/config-devices.mak.tmp GEN arm-softmmu/config-devices.mak GEN cris-softmmu/config-devices.mak.tmp GEN cris-softmmu/config-devices.mak GEN i386-softmmu/config-devices.mak.tmp GEN i386-softmmu/config-devices.mak GEN lm32-softmmu/config-devices.mak.tmp GEN lm32-softmmu/config-devices.mak GEN m68k-softmmu/config-devices.mak.tmp GEN m68k-softmmu/config-devices.mak GEN microblaze-softmmu/config-devices.mak.tmp GEN microblaze-softmmu/config-devices.mak GEN microblazeel-softmmu/config-devices.mak.tmp GEN microblazeel-softmmu/config-devices.mak GEN mips-softmmu/config-devices.mak.tmp GEN mips-softmmu/config-devices.mak GEN mips64-softmmu/config-devices.mak.tmp GEN mips64-softmmu/config-devices.mak GEN mips64el-softmmu/config-devices.mak.tmp GEN mips64el-softmmu/config-devices.mak GEN mipsel-softmmu/config-devices.mak.tmp GEN mipsel-softmmu/config-devices.mak GEN moxie-softmmu/config-devices.mak.tmp GEN moxie-softmmu/config-devices.mak GEN or32-softmmu/config-devices.mak.tmp GEN or32-softmmu/config-devices.mak GEN ppc-softmmu/config-devices.mak.tmp GEN ppc-softmmu/config-devices.mak GEN ppc64-softmmu/config-devices.mak.tmp GEN ppc64-softmmu/config-devices.mak GEN ppcemb-softmmu/config-devices.mak.tmp GEN ppcemb-softmmu/config-devices.mak GEN s390x-softmmu/config-devices.mak.tmp GEN s390x-softmmu/config-devices.mak GEN sh4-softmmu/config-devices.mak.tmp GEN sh4-softmmu/config-devices.mak GEN sh4eb-softmmu/config-devices.mak.tmp GEN sh4eb-softmmu/config-devices.mak GEN sparc-softmmu/config-devices.mak.tmp GEN sparc-softmmu/config-devices.mak GEN sparc64-softmmu/config-devices.mak.tmp GEN sparc64-softmmu/config-devices.mak GEN tricore-softmmu/config-devices.mak.tmp GEN tricore-softmmu/config-devices.mak GEN unicore32-softmmu/config-devices.mak.tmp GEN unicore32-softmmu/config-devices.mak GEN x86_64-softmmu/config-devices.mak.tmp GEN x86_64-softmmu/config-devices.mak GEN xtensa-softmmu/config-devices.mak.tmp GEN xtensa-softmmu/config-devices.mak GEN xtensaeb-softmmu/config-devices.mak.tmp GEN xtensaeb-softmmu/config-devices.mak GEN aarch64-linux-user/config-devices.mak.tmp GEN aarch64-linux-user/config-devices.mak GEN alpha-linux-user/config-devices.mak.tmp GEN alpha-linux-user/config-devices.mak GEN arm-linux-user/config-devices.mak.tmp GEN arm-linux-user/config-devices.mak GEN armeb-linux-user/config-devices.mak.tmp GEN armeb-linux-user/config-devices.mak GEN cris-linux-user/config-devices.mak.tmp GEN cris-linux-user/config-devices.mak GEN i386-linux-user/config-devices.mak.tmp GEN i386-linux-user/config-devices.mak GEN m68k-linux-user/config-devices.mak.tmp GEN m68k-linux-user/config-devices.mak GEN microblaze-linux-user/config-devices.mak.tmp GEN microblaze-linux-user/config-devices.mak GEN microblazeel-linux-user/config-devices.mak.tmp GEN microblazeel-linux-user/config-devices.mak GEN mips-linux-user/config-devices.mak.tmp GEN mips-linux-user/config-devices.mak GEN mips64-linux-user/config-devices.mak.tmp GEN mips64-linux-user/config-devices.mak GEN mips64el-linux-user/config-devices.mak.tmp GEN mips64el-linux-user/config-devices.mak GEN mipsel-linux-user/config-devices.mak.tmp GEN mipsel-linux-user/config-devices.mak GEN mipsn32-linux-user/config-devices.mak.tmp GEN mipsn32-linux-user/config-devices.mak GEN mipsn32el-linux-user/config-devices.mak.tmp GEN mipsn32el-linux-user/config-devices.mak GEN or32-linux-user/config-devices.mak.tmp GEN or32-linux-user/config-devices.mak GEN ppc-linux-user/config-devices.mak.tmp GEN ppc-linux-user/config-devices.mak GEN ppc64-linux-user/config-devices.mak.tmp GEN ppc64-linux-user/config-devices.mak GEN ppc64abi32-linux-user/config-devices.mak.tmp GEN ppc64abi32-linux-user/config-devices.mak GEN ppc64le-linux-user/config-devices.mak.tmp GEN ppc64le-linux-user/config-devices.mak GEN s390x-linux-user/config-devices.mak.tmp GEN s390x-linux-user/config-devices.mak GEN sh4-linux-user/config-devices.mak.tmp GEN sh4-linux-user/config-devices.mak GEN sh4eb-linux-user/config-devices.mak.tmp GEN sh4eb-linux-user/config-devices.mak GEN sparc-linux-user/config-devices.mak.tmp GEN sparc-linux-user/config-devices.mak GEN sparc32plus-linux-user/config-devices.mak.tmp GEN sparc32plus-linux-user/config-devices.mak GEN sparc64-linux-user/config-devices.mak.tmp GEN sparc64-linux-user/config-devices.mak GEN tilegx-linux-user/config-devices.mak.tmp GEN tilegx-linux-user/config-devices.mak GEN x86_64-linux-user/config-devices.mak.tmp GEN x86_64-linux-user/config-devices.mak GEN config-all-devices.mak GEN config-host.h (cd /home/phantom01/work/qemu/pixman; autoreconf -v --install) /bin/sh: 1: autoreconf: not found Makefile:211: recipe for target '/home/phantom01/work/qemu/pixman/configure' failed make: *** [/home/phantom01/work/qemu/pixman/configure] Error 127
去 ./pixman/
目录下看了一下,确实没有configure
文件,可是有一个configure.ac
。因此须要autoreconf
工具,将这个configure.ac
生成对应的configure
文件。
因此,接下来我安装了autoreconf
:
apt-get install autoconf automake libtool
而后切换到pixman
目录下面执行
autoreconf -v --install
来生成configure
文件。
而后在切到qemu
目录下执行make。而后在 sudo make install
成功。
为方便操做,创建软链接:
sudo ln -s /usr/local/bin/qemu-system-i386 /usr/local/bin/qemu
注意点: make失败是不要clean再从新make。由于在make过程当中会改变一些make文件,因此clean掉可能会出一些问题。
qemu下载地址:http://wiki.qemu.org/Download
来源: http://jingyan.baidu.com/article/2fb0ba40541a5900f2ec5f07.html
在平常工做或学习中咱们常常须要在一台电脑上同时使用Windows和Linux(这里以Ubuntu为例)两个系统,咱们一般的作法有两种:
一种安装双系统(双系统的安装方法经验里已经有不少,你们能够去参照)
另外一种更为广泛的是在Windows本机用虚拟机安装Linux系统,然而Windows本机与虚拟机内Linux系统的文件该如何交换呢,其实也有好多方法,如USB接口设备共享、Ftp服务器共享等,这里主告诉告诉你们一种更为方便办法“共享文件夹”(这个方法在windows虚拟系统上设置比较简单),下面咱们看看如何让Windows本机和Linux虚拟系统之间共享文件夹。
Windows XP 以上操做系统
bdshare
目录,接着执行mount -t vboxsf BaiduShare /mnt/bdshare/
,就能完成共享文件夹的设置。/etc/fstab
中添加一项BaiduShare /mnt/share vboxsf rw,gid=110,uid=1100,auto 0 0
卸载挂载点命令:umount -f /mnt/share