Ubuntu 12.04.3-Desktop-i386のインストール
Unetbootin を使ってインストール(CDインストールに対応していなかった.)
TPMを使う準備
初期の設定など
まずは,BIOS画面でTPMを有効にする.
$ apt-get install trousers tpm-tools libtspi-dev
$ tpm_takeownership -z
$ tpm_setenable -e
$ tpm_setactive
/*ここまででtpmをアクティブにできました.以下は適当にテストをするくらい.*/
$ tpm_getpubek
Trusted-GRUB
GRUB2->GRUB Legacy
Trusted-GRUBはGRUB2に対応していないのでGRUB Legacyへ変更する.
$ mv /boot/grub /boot/grub2 /*これを消したらミスってgrub rescue出てきたときにめちゃこまる!!*/
$ apt-get remove grub-pc
$ mkdir /boot/grub
$ apt-get install grub
$ update-grub
$ grub-install /dev/sda1 <=環境によって異なる.
これだけだとちゃんと起動しなかったので
.
$ sudo grub
grub > root (hd0,0)
grub > setup (hd0)
grub > quit
でok.
起動のときに grub rescue > と出てしまったら、、、
ひとまず以下を試す.
grub rescue > ls
hd0 hd0,msdos1 hd0,msdos5
grub rescue > ls (hd0,msdos1)/boot/grub2
--なんか色々出てきたらおk --
--出てこない場合は,lsの出力のうちどれで出るか調べる--
grub rescue > set prefix=(hd0,msdos1)/boot/grub2
grub rescue > set root=hd0,msdos1
grub rescue > insmod (hd0,msdos1)/boot/grub2/normal.mod
grub rescue > normal
で復旧可能.その後,GRUBの導入手順が間違っていないか確認する.
Trusted-GRUBのインストール
PCが起動してからシステムが起動するまでのハッシュ値を計測してくれます.
インストールに必要なものを最初に入れる.
$ apt-get install automake autoconf
$ wget Trusted GRUB 1.1.5 (URLは適当に調べる)
$ gunzip Trusted-GRUB-1.1.5.tar.gzip
$ tar -xf Trusted-GRUB-1.1.5.tar
$ cd Trusted-GRUB-1.1.5
$ ./build_tgrub.sh
$ cd Trusted-GRUB-1.1.5
$ ./configure
$ make
エラーがでなければok.
次にREADMEにしたがって/boot/grubの書き換えを行う.
$ cp -rf /boot/grub /boot/grub_old
$ rm /boot/grub/stage*
$ rm /boot/grub/ *1_5
$ cp stage1/stage1 /boot/grub
$ cp stage2/stage2 /boot/grub
$ grub
grub > root (hd0,0)
grub > setup (hd0)
grub > quit
でインストールが終了.
Xenのインストール
ソースをいじることは今回ないので普通にインストールする.
$ apt-get install xen-hypervisor-4.1-i386
$ apt-get install xen-tools virt-manager
rebootする.
ここから通常に動かすまでが大変っぽいのでがんばる.
virt-managerに怒られる
設定ファイルを変更する.
$ vi /etc/xen/xend-config.sxp
以下のコメントアウトを外し,xend-unix-server no -> yesに変える
#(xend-unix-server no)
#(xend-unix-path /var/lib/xend/xend-socket)
$ service xend restart
でvirt-managerに怒られることはなくなった.
無線Lanがなくなる
実験環境で無線lanを使いたいので対処する.
$ sudo vi /etc/xen/xend-config.sxp
Virt-install
今回VMのインストール,起動にはvirt-installを用いる.
vmの起動方法(vmは既に作成済み)
$ sudo virt-install --import --name vmname --ram 512 --vcpus 1 --disk path=/home/takuya/vm.img --force --graphics vnc,listen=0.0.0.0,port=5901 --noautoconsole
最終更新:2014年01月27日 15:27