VirtualBox で Ubuntu Server on Ubuntu Server。 (2) ゲストマシンの作成
VirtualBox で Ubuntu Server on Ubuntu Server。の第2弾です。前回はVirtualBoxのインストールを行いました。今回はゲストマシンを作成します。
1. バーチャルマシン名を決めて作成。
$ VBoxManage createvm --name "gingham_vm" --register Virtual machine 'gingham_vm' is created and registered. UUID: 29a7b370-b5c7-4d4e-9de6-a3786d982740 Settings file: '/home/naoyes/VirtualBox VMs/gingham_vm/gingham_vm.vbox'
2. 作成したバーチャルマシンをいろいろ設定
# メモリは512MB、DVDブートとし、ネットワークはブリッジ接続とします。ACPIはよくわからないのですが省電力用?とりあえず参考サイトに倣ってONにしておきます。 $ VBoxManage modifyvm "gingham_vm" --memory 512 --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0 # 10GBの容量を持つ仮想ディスクを作成します。 $ VBoxManage createhd --filename VHD_10GB.vdi --size 10240 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Disk image created. UUID: 0ef961f2-9cb8-41ba-8b0a-b9eed4edfe9a # SATAのコントローラを作成 $ VBoxManage storagectl "gingham_vm" --name SATA_Ctrl --add sata --controller IntelAHCI # SATAに先ほど作成した仮想ディスクを適用します。 $ VBoxManage storageattach "gingham_vm" --storagectl SATA_Ctrl --port 0 --device 0 --type hdd --medium VHD_10GB.vdi
3. Ubuntu Server のインストールディスクイメージを適用
# isoファイルをダウンロード $ mkdir $HOME/tmp $ cd $HOME/tmp $ wget http://releases.ubuntu.com/oneiric/ubuntu-11.10-server-i386.iso # IDEのコントローラを作成 $ VBoxManage storagectl "gingham_vm" --name IDE_Ctrl --add ide # IDEに先ほどダウンロードしてきたゲストOSのISOイメージを適用します。 $ VBoxManage storageattach "gingham_vm" --storagectl IDE_Ctrl --port 0 --device 0 --type dvddrive --medium /home/naoyes/tmp/ubuntu-11.10-server-i386.iso
以下のサイトを参考にしました。
- Chapter 8. VBoxManage
- VBoxHeadless - Running Virtual Machines With VirtualBox 4.0 On A Headless Ubuntu 11.04 Server
次回は「ゲストマシンの起動」です。