Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
en:c2_ubuntu_cloud [2016/05/30 11:52] brian.kim [Changing timer] |
en:c2_ubuntu_cloud [2017/07/20 08:21] (current) luke.go [How do you increase a guest's disk size?] |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Ubuntu Cloud using KVM/ARM ====== | + | ====== Running Ubuntu 16.04 Cloud image using KVM/ARM ====== |
- | The CPU core in ODROID-C2 is [[http://www.arm.com/products/processors/cortex-a/cortex-a53-processor.php|the Cortex-A53 processor]]. The Cortex-A53 processor supports [[https://www.arm.com/products/processors/technologies/virtualization-extensions.php|the virtualization extensions]] for the hypervisor such as Xen and KVM. This is a step-by-step guide of how to run //**unmodified**// Ubuntu Cloud using KVM/ARM on ODROID-C2 Ubuntu. | + | The CPU core in ODROID-C2 is [[http://www.arm.com/products/processors/cortex-a/cortex-a53-processor.php|the Cortex-A53 processor]]. The Cortex-A53 processor supports [[https://www.arm.com/products/processors/technologies/virtualization-extensions.php|the virtualization extensions]] to support the virtualization. It means ODROID-C2 is able to support the virtualization using the well-known hypervisors such as KVM and Xen. This is a step-by-step guide of how to run //**unmodified**// Ubuntu Cloud using KVM/ARM on ODROID-C2 Ubuntu. |
===== Changing timer ===== | ===== Changing timer ===== | ||
Line 31: | Line 31: | ||
[ 0.497619] kvm [1]: Hyp mode initialized successfully | [ 0.497619] kvm [1]: Hyp mode initialized successfully | ||
</code> | </code> | ||
- | ===== Installing packages ===== | ||
+ | ===== Installing packages & Downloading images ===== | ||
+ | We need not only [[http://wiki.qemu.org/Main_Page|QEMU]] in order to run and manage guest system but cloud-utils for account setting. | ||
+ | <code> | ||
+ | odroid@odroid64:~$ sudo apt install -y qemu qemu-utils cloud-utils | ||
+ | </code> | ||
+ | Download BIOS and Ubuntu 16.04 cloud images. | ||
+ | <code> | ||
+ | odroid@odroid64:~$ wget https://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu64/QEMU_EFI.fd | ||
+ | odroid@odroid64:~$ wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-arm64-uefi1.img | ||
+ | </code> | ||
+ | |||
+ | ===== Setting & Running Ubuntu 16.04 Cloud ===== | ||
+ | Cloud images are plain - there is no user setup, no default user/password combo, so to log in to the image, we need to customize the image on first boot. The defacto tool for this is [[http://cloudinit.readthedocs.io/en/latest/|cloud-init]]. The simplest method for using cloud-init is passing a block media with a settings file - of course for real cloud deployment, you would use one of fancy network based initialization protocols cloud-init supports. Enter the following to a file, say cloud.txt: | ||
+ | |||
+ | Create cloud.txt in order to set the default user account. | ||
+ | <code> | ||
+ | odroid@odroid64:~$ cat > cloud.txt <<EOF | ||
+ | #cloud-config | ||
+ | password: odroid | ||
+ | chpasswd: { expire: False } | ||
+ | ssh_pwauth: True | ||
+ | EOF | ||
+ | odroid@odroid64:~$ cloud-localds cloud.img cloud.txt | ||
+ | </code> | ||
+ | Run the Ubuntu 16.04 cloud now. (//user//: **ubuntu**, //password//: **odroid**) | ||
+ | <code> | ||
+ | odroid@odroid64:~$ qemu-system-aarch64 -smp 2 -m 1024 -M virt -bios QEMU_EFI.fd -nographic \ | ||
+ | -device virtio-blk-device,drive=image \ | ||
+ | -drive if=none,id=image,file=xenial-server-cloudimg-arm64-uefi1.img \ | ||
+ | -device virtio-blk-device,drive=cloud \ | ||
+ | -drive if=none,id=cloud,file=cloud.img \ | ||
+ | -netdev user,id=user -device virtio-net-device,netdev=user \ | ||
+ | -enable-kvm -cpu host | ||
+ | </code> | ||
+ | * //-smp//: Virtual CPU count | ||
+ | * //-m//: Memory size | ||
+ | * //-bios//: Firmware image | ||
+ | * //-nographic//: Console display only | ||
+ | * //-enable-kvm//: Use KVM for the guest | ||
+ | * //-cpu host//: CPU is same between host and guest | ||
+ | |||
+ | {{ :en:kvm-arm.png?1000 |Three Ubuntu 16.04 Cloud}} | ||
+ | |||
+ | ==== How do you increase a guest's disk size? ==== | ||
+ | - Stop the VM | ||
+ | - Run 'qemu-img resize <guest image> +10G' to increase image size by 10Gb | ||
+ | - Start the VM, resize the partitions and LVM structure within it normally | ||
+ | |||
+ | ===== References ===== | ||
+ | * [[http://forum.odroid.com/viewtopic.php?f=138&t=19153|Related thread in ODROID forum]] | ||
+ | * [[http://suihkulokki.blogspot.kr/2016/05/booting-ubuntu-1604-cloud-images-on.html|Booting ubuntu 16.04 cloud images on Arm64]] |