1. 程式人生 > >centos 6.5 32bit qemu 環境搭建

centos 6.5 32bit qemu 環境搭建

安裝centos 6.5 32bit software development distribution


解決ssh連線慢的問題
UseDNS no
GSSAPIAuthentication no


securecrt設定
Options -> Session Options -> Emulation,然後把Terminal型別改成xterm,並點中ANSI Color複選框。
Options -> Session Options -> Appearance,將Character設成"UTF-8"即可(預設是"default")。
字型:建議用fixedsys,這個字型雖然不是最美麗的,但在終端上也是一個不錯選擇,大家都可以接受。


安裝好之後
yum -y install epel-release
yum groupinstall "Development Tools"


安裝python
yum -y install python34
然後會有2個版本python
[
[email protected]
~]# python 
Python 2.6.6 (r266:84292, Nov 22 2013, 12:11:10) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 
[[email protected] ~]# python3
Python 3.4.5 (default, Jun  1 2017, 13:52:14) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> qemu cc cannot build an executable
python3會是py檔案預設直譯器 (default字樣)


安裝binwalk
cd ~/
git clone https://github.com/ReFirmLabs/binwalk.git
cd binwalk
./setup.py install
發現預設安裝到python2.6上去了。
安裝到python3.4
python3 setup.py install
cd ~/
rm -rf binwalk


編譯一些靜態庫(qemu靜態編譯需要)
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.27.tar.gz
tar xzvf libgpg-error-1.27.tar.gz
cd libgpg-error-1.27
./configure --enable-static
make
make install 


wget --no-check-certificate https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.2.tar.bz2
bunzip2 libgcrypt-1.8.2.tar.bz2 
tar xvf libgcrypt-1.8.2.tar
./configure --enable-static
make
make install 


wget --no-check-certificate https://www.cairographics.org/releases/pixman-0.34.0.tar.gz
tar xzvf pixman-0.34.0.tar.gz
cd pixman-0.34.0
./configure --enable-static
make
make install 


gtk-x11-2.0
我曹怎麼還需要這個,放棄了  --disable-gtk,反正只需要命令列的qemu


安裝qemu
yum install zlib-static
yum install glib2-devel libfdt-devel libaio-devel libcap-devel libiscsi-devel zlib-devel pixman-devel
yum install glibc-static libtool
yum install glib2-static glibc-utils glibc glib glib-devel glib-networking
yum install glib*
yum install libgcrypt* 無效 好像缺靜態庫
cd  /opt  
sudo git clone https://github.com/qemu/qemu.git
cd qemu
(可選)git branch -a | grep stable-2
(可選)git checkout stable-2.8
git submodule init  
git submodule update --recursive
export PKG_CONFIG_LIBDIR=/usr/bin/pkg-config
./configure --static --disable-gtk
make -j8
make install