安裝虛擬機器

來源:互聯網
上載者:User

Xen, OpenVZ折騰了幾天還是沒搞清楚,還是先試試只支援安裝ubuntu的vmbuilder吧,KVM

 

$sudo apt-get install ubuntu-vm-builder

 

選一個安裝目,進入

 

$sudo vmbuilder kvm ubuntu -a amd64 --suite karmic --hostname vm01 --iso /home/zjay/vm/ubuntu-9.10-server-amd64.iso --libvirt qemu:///system

 

看下面的時間進度就知道要等多久了

2010-08-19 21:09:57,485 INFO    : Creating disk image: /tmp/vmbuilderC5TXh6/disk0.img

2010-08-19 21:09:57,499 INFO    : Adding partition table to disk image: /tmp/vmbuilderC5TXh6/disk0.img

2010-08-19 21:09:57,547 INFO    : Adding type 1 partition to disk image: /tmp/vmbuilderC5TXh6/disk0.img

2010-08-19 21:09:57,557 INFO    : Adding type 3 partition to disk image: /tmp/vmbuilderC5TXh6/disk0.img

2010-08-19 21:09:57,562 INFO    : [0] ../../libparted/filesys.c:147 (ped_file_system_type_get): File system alias linux-swap(new) is deprecated

2010-08-19 21:09:57,575 INFO    : Creating loop devices corresponding to the created partitions

2010-08-19 21:09:57,596 INFO    : Creating file systems

2010-08-19 21:09:57,615 INFO    : mke2fs 1.41.9 (22-Aug-2009)

2010-08-19 21:09:58,177 INFO    : mkswap: /dev/mapper/loop0p2: warning: don't erase bootbits sectors

2010-08-19 21:09:58,178 INFO    :         on whole disk. Use -f to force.

2010-08-19 21:09:58,183 INFO    : Mounting target filesystems

2010-08-19 21:09:58,190 INFO    : Installing guest operating system. This might take some time...

2010-08-19 21:13:51,349 INFO    : W: GPG error: http://archive.ubuntu.com karmic Release: The following signatures were invalid: BADSIG 40976EAF437D05B5 Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>

2010-08-19 21:14:02,635 INFO    : Searching for GRUB installation directory ... found: /boot/grub

2010-08-19 21:14:02,686 INFO    : Searching for default file ... Generating /boot/grub/default file and setting the default boot entry to 0

2010-08-19 21:14:02,687 INFO    : Searching for GRUB installation directory ... found: /boot/grub

2010-08-19 21:14:02,692 INFO    : Testing for an existing GRUB menu.lst file ...

2010-08-19 21:14:02,693 INFO    : 

2010-08-19 21:14:02,693 INFO    : Could not find /boot/grub/menu.lst file.

2010-08-19 21:14:02,693 INFO    : Generating /boot/grub/menu.lst

2010-08-19 21:14:02,757 INFO    : Searching for splash image ... none found, skipping ...

2010-08-19 21:14:02,898 INFO    : grep: /boot/config*: No such file or directory

2010-08-19 21:14:02,973 INFO    : Updating /boot/grub/menu.lst ... done

2010-08-19 21:14:02,973 INFO    : 

2010-08-19 21:14:03,148 INFO    : Searching for GRUB installation directory ... found: /boot/grub

2010-08-19 21:14:03,202 INFO    : Searching for default file ... found: /boot/grub/default

2010-08-19 21:14:03,203 INFO    : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst

2010-08-19 21:14:03,311 INFO    : Searching for splash image ... none found, skipping ...

2010-08-19 21:14:03,341 INFO    : grep: /boot/config*: No such file or directory

2010-08-19 21:14:03,420 INFO    : Updating /boot/grub/menu.lst ... done

2010-08-19 21:14:03,420 INFO    : 

2010-08-19 21:14:03,446 INFO    : Searching for GRUB installation directory ... found: /boot/grub

2010-08-19 21:15:05,852 INFO    : Done.

2010-08-19 21:15:06,555 INFO    : Running depmod.

2010-08-19 21:15:06,625 INFO    : update-initramfs: Generating /boot/initrd.img-2.6.31-22-server

2010-08-19 21:15:08,710 INFO    : Running postinst hook script /usr/sbin/update-grub.

2010-08-19 21:15:08,800 INFO    : Searching for GRUB installation directory ... found: /boot/grub

2010-08-19 21:15:08,836 INFO    : Searching for default file ... found: /boot/grub/default

2010-08-19 21:15:08,836 INFO    : Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst

2010-08-19 21:15:08,909 INFO    : Searching for splash image ... none found, skipping ...

2010-08-19 21:15:08,938 INFO    : Found kernel: /boot/vmlinuz-2.6.31-22-server

2010-08-19 21:15:09,004 INFO    : Replacing config file /var/run/grub/menu.lst with new version

2010-08-19 21:15:09,020 INFO    : Updating /boot/grub/menu.lst ... done

2010-08-19 21:15:09,020 INFO    : 

2010-08-19 21:15:10,269 INFO    : 

2010-08-19 21:15:10,269 INFO    : Current default time zone: 'Etc/UTC'

2010-08-19 21:15:10,272 INFO    : Local time is now:      Thu Aug 19 13:15:10 UTC 2010.

2010-08-19 21:15:10,273 INFO    : Universal Time is now:  Thu Aug 19 13:15:10 UTC 2010.

2010-08-19 21:15:10,273 INFO    : 

2010-08-19 21:15:13,593 INFO    : update-initramfs: Generating /boot/initrd.img-2.6.31-22-server

Extracting templates from packages: 100%

2010-08-19 21:25:14,080 INFO    : install-info: warning: maintainer scripts should not call install-info anymore,

2010-08-19 21:25:14,081 INFO    : install-info: warning: this is handled now by a dpkg trigger provided by the

2010-08-19 21:25:14,082 INFO    : install-info: warning: install-info package; package gzip should be updated.

2010-08-19 21:25:19,860 INFO    : 

2010-08-19 21:25:19,860 INFO    : Current default time zone: 'Etc/UTC'

2010-08-19 21:25:19,860 INFO    : Local time is now:      Thu Aug 19 13:25:15 UTC 2010.

2010-08-19 21:25:19,861 INFO    : Universal Time is now:  Thu Aug 19 13:25:15 UTC 2010.

2010-08-19 21:25:19,861 INFO    : Run 'dpkg-reconfigure tzdata' if you wish to change it.

2010-08-19 21:25:19,861 INFO    : 

2010-08-19 21:25:30,022 INFO    : Copying to disk images

2010-08-19 21:25:34,463 INFO    : Installing bootloader

2010-08-19 21:25:39,196 INFO    : Unmounting target filesystem

2010-08-19 21:25:42,395 INFO    : Converting /tmp/vmbuilderC5TXh6/disk0.img to qcow2, format ubuntu-kvm/disk0.qcow2

2010-08-19 21:25:46,677 INFO    : Cleaning up

 

完成後

$sudo virsh

Domain vm01 started

#list --all

 Id Name                 State

----------------------------------

  1 vm01                 shut off

 

#start vm01

Domain vm01 started

 

在一個ubuntu desktop上安裝vir viewer

$sudo apt-get install virt-viewer

$virt-viewer -c qemu+ssh://zjay@10.20.134.51/system vm01

zjay@10.20.134.51's password:******

zjay@10.20.134.51 是虛機所在的宿主機的ssh入口,輸入相應的ssh密碼

 

建立的ubuntu虛機的帳號密碼俱為ubuntu

 


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.