首先下载qemu:
git clonegit://git.sv.gnu.org/qemu.git或者自行下载需要版本http://wiki.qemu.org/Download
然后安装
cd qemu
./configure--enable-kvm --target-list="x86_64-softmmu" //选择对应的系统版本和位数
make && makeinstall
安装过程可能出现的错误解决办法:
安装glib:apt-get install libglib2.0-dev
安装libtool:apt-get install libtool
解决依赖模块更新:
git submodule update --init pixman
gitsubmodule update --init dtc若更新不成功则需手动执行将下载的dtc-1760e7c.tar.gz的内容拷贝到qemu目录下的dtc/中
dtc下载地址:git.qemu-project.org/?p=dtc.git;a=snapshot;h=1760e7ca03894689118646e229ca9487158cd0e8;sf=tgz
######################################################################################################################
问题详解(转载):
http://itdrafts.blogspot.jp/2015/07/qemu-unable-to-find-current-revision-in.html
root@laikc-virtual-machine:~# root@laikc-virtual-machine:~# git clone git://git.qemu-project.org/qemu.git
remote: Counting objects: 191623, done.
remote: Compressing objects: 100% (44312/44312), done.
remote: Total 191623 (delta 153059), reused 183484 (delta 146 732)
Receiving objects: 100% (191623/191623), 63.02 MiB | 456 KiB/s, done.
Resolving deltas: 100% (153059/153059), done.
Checking out files: 100% (3603/3603), done.
cd gemu
檢查 ./configure 參數
./configure --help
Usage: configure [options]
Options: [defaults in brackets after descriptions]
Standard options:
--help print this message
--prefix=PREFIX install in PREFIX [/usr/local]
--interp-prefix=PREFIX where to find shared libraries, etc.
use %M for cpu name [/usr/gnemul/qemu-%M]
--target-list=LIST set target list (default: build everything)
Available targets: aarch64-softmmu alpha-softmmu
arm-softmmu cris-softmmu i386-softmmu lm32-softmmu
m68k-softmmu microblaze-softmmu microblazeel-softmmu
mips-softmmu mips64-softmmu mips64el-softmmu
mipsel-softmmu moxie-softmmu or32-softmmu
ppc-softmmu ppc64-softmmu ppcemb-softmmu
s390x-softmmu sh4-softmmu sh4eb-softmmu
sparc-softmmu sparc64-softmmu unicore32-softmmu
x86_64-softmmu xtensa-softmmu xtensaeb-softmmu
aarch64-linux-user alpha-linux-user arm-linux-user
armeb-linux-user cris-linux-user i386-linux-user
m68k-linux-user microblaze-linux-user
microblazeel-linux-user mips-linux-user
mips64-linux-user mips64el-linux-user
mipsel-linux-user mipsn32-linux-user
mipsn32el-linux-user or32-linux-user ppc-linux-user
ppc64-linux-user ppc64abi32-linux-user
s390x-linux-user sh4-linux-user sh4eb-linux-user
sparc-linux-user sparc32plus-linux-user
sparc64-linux-user unicore32-linux-user
x86_64-linux-user
Advanced options (experts only):
--source-path=PATH path of source code [/root/qemu]
--cross-prefix=PREFIX use PREFIX for compile tools []
--cc=CC use C compiler CC [cc]
--iasl=IASL use ACPI compiler IASL [iasl]
--host-cc=CC use C compiler CC [cc] for code run at
build time
--cxx=CXX use C++ compiler CXX [c++]
--objcc=OBJCC use Objective-C compiler OBJCC [cc]
--extra-cflags=CFLAGS append extra C compiler flags QEMU_CFLAGS
--extra-ldflags=LDFLAGS append extra linker flags LDFLAGS
--make=MAKE use specified make [make]
--install=INSTALL use specified install [install]
--python=PYTHON use specified python [python -B]
--smbd=SMBD use specified smbd [/usr/sbin/smbd]
--static enable static build [no]
--mandir=PATH install man pages in PATH
--datadir=PATH install firmware in PATH/qemu
--docdir=PATH install documentation in PATH/qemu
--bindir=PATH install binaries in PATH
--libdir=PATH install libraries in PATH
--sysconfdir=PATH install config in PATH/qemu
--localstatedir=PATH install local state in PATH (set at runtime on win32)
--with-confsuffix=SUFFIX suffix for QEMU data inside datadir/libdir/sysconfdir [/qemu]
--enable-modules enable modules support
--enable-debug-tcg enable TCG debugging
--disable-debug-tcg disable TCG debugging (default)
--enable-debug-info enable debugging information (default)
--disable-debug-info disable debugging information
--enable-debug enable common debug build options
--enable-sparse enable sparse checker
--disable-sparse disable sparse checker (default)
--disable-strip disable stripping binaries
--disable-werror disable compilation abort on warning
--disable-stack-protector disable compiler-provided stack protection
--disable-sdl disable SDL
--enable-sdl enable SDL
--with-sdlabi select preferred SDL ABI 1.2 or 2.0
--dis