[轉] virt-builder, to trivially create various Linux distribution guest images

來源:互聯網
上載者:User

標籤:des   http   strong   2014   art   html   

http://kashyapc.com/2014/01/27/virt-builder-to-trivially-create-various-linux-distribution-guest-images/

I frequently use virt-builder (part of libguestfs-tools package) as part of my work flow.

Rich has extensively documented it, still I felt it’s worth pointing out again of its sheer simplicity.

For instance, if you need to create a Fedora 20 guest of size 100G, and of qcow2 format, it’s as trivial as (no need for root login):

$ virt-builder fedora-20 --format qcow2 --size 100G[   1.0] Downloading: http://libguestfs.org/download/builder/fedora-20.xz#######################################################################  100.0%[ 131.0] Planning how to build this image[ 131.0] Uncompressing[ 139.0] Resizing (using virt-resize) to expand the disk to 100.0G[ 220.0] Opening the new disk[ 225.0] Setting a random seed[ 225.0] Setting random root password [did you mean to use --root-password?]Setting random password of root to N4KkQjZTgdfjjqJJ[ 225.0] Finishing offOutput: fedora-20.qcow2Output size: 100.0GOutput format: qcow2Total usable space: 97.7G      Free space: 97.0G (99%)

Then, import the just created image:

$ virt-install --name guest-hyp --ram 8192 --vcpus=4   --disk path=/home/test/vmimages/fedora-20.qcow2,format=qcow2,cache=none   --import

It provides a serial console for login.

You could also create several other distribution variants – Debian, etc

http://libguestfs.org/virt-builder.1.html

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.