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/011.jpg
  2. Select Ubuntu 18.04 LTS operating system

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

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

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

    ../../../_images/061.jpg
    ../../../_images/081.jpg
    ../../../_images/091.jpg
    ../../../_images/101.jpg
  6. Connect..

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

    ../../../_images/141.jpg
    ../../../_images/151.jpg
  8. Choose language,

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

    ../../../_images/171.jpg
  10. timezone,

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

    Warning

    Don’t use automatic log in!

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

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

    sudo apt update
    

Change partition size

Install gparted - sudo apt install gparted

../../../_images/211.jpg

Start gparted - sudo gparted

../../../_images/221.jpg

Resize /dev/sda1 partition:

../../../_images/231.jpg
../../../_images/241.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