Successfully flashed Jetson Nano emmc module through virtualbox on OSX

Just wanted to share the settings I found that enabled me to run flash.sh successfully through a virtualbox Ubuntu18.04 VM set up through vagrant on OSX:

Rough steps:

  • use brew to install vagrant, virtualbox
  • add vagrant box generic/ubuntu1804 for virtualbox
  • resize vagrant ubuntu1804 image to 60GB
    cd ~/.vagrant.d/boxes/generic-VAGRANTSLASH-ubuntu1804/2.0.6/virtualbox/ VBoxManage clonehd generic-ubuntu1804-virtualbox-disk001.vmdk generic-ubuntu1804-virtualbox-disk001-resized.vdi --format VDI
    $ VBoxManage modifyhd generic-ubuntu1804-virtualbox-disk001-resized.vdi --resize 61200
  • Use VirtualBox GUI manager to create new 64-bit Linux VM named ubuntu1804-resized using generic-ubuntu1804-virtualbox-disk001-resized.vdi as disk image
  • package newly created VirtualBox VM into a vagrant box, then add it to vagrant boxes:
    vagrant package --base ubuntu1804-resized --output ~/.vagrant.d/boxes/generic-VAGRANTSLASH-ubuntu1804-resized.box vagrant box add generic/ubuntu1804-resized file:///Users//.vagrant.d/boxes/generic-VAGRANTSLASH-ubuntu1804-resized.box
    vagrant up vagrant ssh
    sudo growpart /dev/sda 3 sudo resize2fs /dev/sda3
    $ sudo shutdown -h now
  • install Oracle VM VirtualBox Extension Pack from: https://www.virtualbox.org/wiki/Downloads
  • Enable USB3.0 with ‘remote->always’ option through VirtualBox GUI
    • select virtual machine (2nd instance of ubuntu1804-resized) -> settings → ports → USB → Click “Enable USB Controller” → select USB 3.0 (xHCI) Controller
    • click + button to add device, select NVIDIA APX device (when Jetson Nano is booted into USB recovery mode and plugged into host machine)
    • select gear icon to configure filter, click drop-down box for “Remote:” and select “Any”

Then I do a sequence of:

  • unpacking nvidia toolchain, base release package, and sample rootfs
  • download nvidia kernel sources with source_sync.sh, apply custom kernel patches and compile
  • chroot to install additional packages (cuda, argus, cmake, etc)
  • use the l4t_create_default_user.sh script found in the forums to create default user

at which point I can run flash.sh from virtualbox and after finishing directly login to the device through ssh with all device tree, kernel, and packages prepared for my application install.

hope that others might find this interesting and/or useful. handy to have some extra development machines/flash stations around

Cool! Thanks for the sharing!