Ubuntu on Windows 10

Enable Hyper-V

  1. Enable Hyper-V to create virtual machines on Windows 10

    See Install Hyper-V on Windows 10

Create Virtual Machine

  1. Open Hyper-V Quick Create from the start menu.

    ../../../_images/01.jpg
  2. Select Ubuntu 18.04 LTS operating system

    ../../../_images/02.jpg
  3. Create virtual computer

    ../../../_images/03.jpg
  4. Edit the configuration

    ../../../_images/05.jpg
  5. Increase the disk size

    ../../../_images/06.jpg
    ../../../_images/08.jpg
    ../../../_images/09.jpg
    ../../../_images/10.jpg
  6. Connect..

    ../../../_images/12.jpg
  7. ..and start virtual appliance

    ../../../_images/14.jpg
    ../../../_images/15.jpg
  8. Choose language,

    ../../../_images/16.jpg
  9. keyboard layout,

    ../../../_images/17.jpg
  10. timezone,

    ../../../_images/18.jpg
  11. and user settings.

    Warning

    Don’t use automatic log in!

    ../../../_images/19.jpg
  12. Log in, open a terminal

    ../../../_images/20.jpg
  13. and update apt

    sudo apt update
    

Change partition size

Install gparted - sudo apt install gparted

../../../_images/21.jpg

Start gparted - sudo gparted

../../../_images/22.jpg

Resize /dev/sda1 partition:

../../../_images/23.jpg
../../../_images/24.jpg

Image Deployment

After a Yocto build is complete, the created images and files are stored in a <deploy> directory. The target usually is programmed with these files over USB. Unfortunately USB pass-through between host and a Hyper-V guest is not supported by default. Programming a target should therefore be done from the Windows host. The data built on a virtual machine has to be shared to the host. One possible approach is shown here.

On your Windows host:

Add a network share - e.g. \\<windows-hostname>\<windows-shared-folder>

On your Ubuntu machine:

  1. Add a mount point for sharing

    mkdir ~/shared-folder
    
  2. Install cifs-utils

    sudo apt-get install cifs-utils
    
  3. Mount the shared folder

    sudo mount.cifs //<windows-hostname>/<windows-shared-folder> ~/shared-folder -o user=<windows-username>,uid=$(id -u),gid=$(id -g)
    
  4. Copy <deploy> to host (-L follow symbolic links in SOURCE)

    cp -RL <deploy-folder>/. ~/shared-folder