云计算 作业2

Homework 2


Q: Create a Virtual Machine on KVM.

  • Install VMware Worktaon

  • Install Linux/KM

    1. Create a New Virtual Machine.
    2. Select “Custom (advanced) and click Next”.
    3. Click next unl you reach the page “Guest Operang System Installaon”
    4. Download the iso image for Ubuntu-XX.XX.X from here.
    5. Connue to setup your VM spec.
    6. We then need to expose the hardware virtualizaon feature to the KVM running in the VM. On VMware Workstaon, go to Processors of your VM configuraon, then select both “Virtualize Intel VT-x/EPT and AMD-V/RVI” and “Virtualize CPU performance counters”.
    7. Click “Finish” and Install Ubuntu-XX.XX.X on your VM.
  • configure the environment for KVM. Input the following command:

     sudo apt-get update  
     sudo apt-get install qemu-kvm
     libvirt-bin ubuntu-vm-builder bridge-utils \  libosinfo-bin libguestfs-tools virt-top virtinst
    
  • Install VM on KVM

    1. Type the following command to install a Ubuntu XX.XX.XX guest.
      virt-install \  
      --name guest0 \
      --virt-type=kvm \  
      --ram 1024 \  
      --disk path=guest0.img,size=25 \  
      --vcpus 2 \  
      --os-type linux \  
      --graphics none \  
      --console pty,target_type=serial \  
      --location 'http://us.archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64
      --extra-args 'console=ttyS0,115200n8 serial'
      
    2. Aer seng language, locaon, keyboard and other basic sengs, we need to choose a mirror of ubuntu.
    3. Input the username and password.
    4. Choose a disk to install.
    5. Complete it.( Which takes so much me ).
  • Modify /etc/default/grub in VM

    1. Login.
    2. Find “grub”, change permission and open it by vi.
    3. Modify it.
    4. Update.
    5. Shutdown VM.

你可能感兴趣的:(kvm)