It is also available for use here: https://github.com/columbia-university-robotics/moveit-instructions/tree/main/bootubuntufromUSB-instructions
There are many options for installing Ubuntu on your computer: Native boot or dual-boot, Boot from USB flash drive, Virtual machines, Docker, etc.
In this tutorial we will learn how to boot from USB flash drive. This option is good because it does not alter your existing operating system. (These instructions should work whether you have a PC or Mac.)
The screenshots in the tutorial below are for reference only, and the USB sizes that are in the images may not match what is stated in the text. Please follow the written steps, and only use the screenshots to double check your work. Please make sure to choose the correct option for your USB size, else you risk deleting all of your computer's memory.
I bought the drive in this link, but there are many others available at different price points. Make the USB you buy is at least a USB 3.0 and has at least 16GB capacity.
You should have a random flash drive lying around your house. You will need it!
If not, you will need a USB multiport hub.
I would recommend getting an external mouse and keyboard because Ubuntu may not recognize the in-built mouse and keyboard due to missing plugins. Keep in mind that if you get a wired external mouse and keyboard then ensure that your machine has that many USB type A ports.
On my Microsoft Surface Pro, I was able to use the trackpad but not keyboard, so I enabled the on-screen keyboard through the Accessibility settings. On my Microsoft Surface Laptop, I wasn't able to use the trackpad or keyboard, leaving me without any way to use the machine. So I had to get an external mouse and keyboard.
Go to Ubuntu Download Page and get Ubuntu 20.04.
Ignore step 3 if you have macOS. Instead, follow instructions on this link.
Rufus is a free and open-source USB stick writing tool. I downloaded the portable version from this link.
Click on the 4GB USB device from the “Device” field.
Click the select to the right of “Boot selection”. Select the appropriate ISO file and click on Open.
Leave all other parameters with their default values and click start to initiate the write process.
You may be alerted that Rufus requires additional files to complete writing the ISO. If this dialog box appears, select yes to continue. You will then be alerted that Rufus has detected that the Ubuntu ISO is an ISOHybrid image. Keep Write in ISO Image mode selected and click on OK to continue. Rufus will also warn you that all data on your selected USB device is about to be destroyed. This is a good moment to double check you’ve selected the correct device before clicking OK when you’re confident you have.
The ISO will now be written to your USB stick, and the progress bar in Rufus will give you some indication of where you are in the process. When Rufus has finished writing the USB device, the Status bar will be green filled and the word READY will appear in the center. Select CLOSE to complete the write process.
Read your manufacturer’s instructions on how to boot from a USB.
Note: My Microsoft Surface Laptop would continuously boot from Windows even though I pressed the Volume Down key while booting. To fix this you will need to go to the UEFI Firmware settings on your machine (either by holding the Volume Up key while booting, or go to Windows Settings -> Update & Security -> Recovery -> Advanced Startup -> Restart Now). Then your machine will restart into the UEFI Firmware. Navigate to "Boot Configuration" and move the order of "USB Device" to the top (above Windows). My Surface Laptop then boots directly in recovery mode to the GNU GRUB menu. Type "exit" and then press enter to be taken to the recovery menu again, from where you can select "Boot from USB" again.
Step 4C: Power on your machine into the Boot Menu (by pressing F12 or volume down or whatever your manufacturer steps are).
My Windows machine would display two options: one to “boot from USB” and another to “boot from ubuntu”. If this happens to you, choose the “boot from USB” option.
Your machine should boot as Ubuntu OS on the 4GB USB.
The system will boot into the Ubuntu live desktop environment.
We will now configure your 128GB USB to have a persistent storage space. This means that you can install software and edit code on it, and changes will be preserved each time you reboot.
Step 6A: While leaving your 4GB USB inserted, also insert your 128GB USB into the computer or USB hub.
Pay attention to the drives and make sure you are selecting the 128GB flash drive (should be sdb).
Step 6D: Clear partitions on the USB drive by right-clicking on your USB, choose Format then select the cleared option.
Step 6F: An alert message will appear warning you about losing data when formatting the USB. Click Apply on the alert message.
Step 6H: The USB should be like the below screenshot. You can now close the GParted application. You have successfully partitioned your USB drive to be able to install Ubuntu.
Now select your preferred language and click on the Install Ubuntu button. Press continue. Next, select the Keyboard layout, here I am choosing English US. You can select any other layout which you are using right now on your Windows 10 PC or laptop. Press continue. Select Normal Installation and the “install third-party software” button. Press continue.
- FAT32 partition
- Set the size to be around 74000 MB
- Set the mount point to /fatpartition
- Location for new partition: Beginning of this space
- Primary partition
- EXT4 partition
- Set size to the remaining space
- Set the mount point to /
- Location for new partition: Beginning of this space
- Logical partition
You can also use the below screenshot for reference. This screenshot has a swap partition as well but we have not done it for our use case.
If (while trying to boot your machine in Ubuntu or Windows) your machine takes you to GRUB screen with a command line, just type "exit" and the machine will take you to an Advanced Recovery page where you can choose to boot from whatever device you desire.
Step 9A: Now enter the password which you created during installation setup and you will be logged into Ubuntu desktop.
Step 9C: Click on the "Power" tab (near the bottom). Where it says Power Saving click on where it says "5 minutes" and change it to "Never".
- Do not remove the USB while your machine is running Ubuntu. Always make sure to power the machine off before removing the USB.
- After install is complete, I would recommend that you try to boot your computer using Windows/macOS to make sure you are able to boot normally.
- My Microsoft Surface Laptop gets stuck in the boot mode when I try to boot from Windows after having just run Ubuntu.
- That is because the UEFI Firmware settings (Boot Configuration) added a new "ubuntu" boot option to the top of the list.
- You will need to restart your machine and go back to UEFI Firmware settings (as described in step 4).
- Delete the ubuntu option and leave the remaining options as is (leave USB above Windows).
- Restart your machine and it should boot in Windows.