Update Ubuntu Development Environment authored by jesseg64's avatar jesseg64
[Next Chapter >>](Petalinux-Tools-Install)
---
This guide will walk you through setting up an Ubuntu 18.04.4 virtual machine on Virtual Box.
Please note before you get started that you will need at least 200GB of free drive space. It's also highly recommended that your drive be an SSD for the best performance (although it will work just fine if installed on a disk drive).
# Download Virtualbox and .iso installer
- [Virtual Box](https://www.virtualbox.org/wiki/Downloads)
- [Ubuntu 18.04.4 iso](https://old-releases.ubuntu.com/releases/18.04.4/)
# Create a new VM in Virtualbox
Click ![image](uploads/6a352cffe6cab2b8f0102b9b6fb9595c/image.png)
Give it a name and select your downloaded .iso file ![image](uploads/0799ad71bceb6c00df9dc32573bbe101/image.png)
Click next and fill out the unattended guest OS setup ![image](uploads/35554fe632b99055de8a5b07d5bb3d62/image.png)
Click next and give it 4096MB (or more) RAM and 2 processors ![image](uploads/2eb7f8c7befb3cbbedfbe47fcfc54f45/image.png)
> Note: If you can, we suggest to give it much more RAM. It depends on your system's capabilities.
> Note: We were experiencing strange stuttering of the VM when the processor count wasn't set to 2, so probably best to keep it at 2. Your results may vary.
Click next and give it at least **200 GB** of hard disk space ![image](uploads/78008d7f4a7a9dd3620abbfe3436a276/image.png)
> Petalinux and Vivado/Vitis require a LOT of drive space. We don't suggest going below that for your drive.
Here is my final configuration screen. Make sure your values are similar. ![image](uploads/8108ccdecd9e800aa368f8c601d33e9a/image.png)
Click finish.
# Set up the VM
Start your VM if it hasn't already. You should be greeted with an install screen. It should install and configure your OS for you (unattended). ![image](uploads/1b7e92f878ee613a126f82d0f240e4f9/image.png)
To get auto screen resizing and native clipboard support, install the VBox_GAs. Navigate to devices -> Insert Guest Additions CD Image in Virtualbox, and click Run when it appears on the Ubuntu desktop.
![image](uploads/76a4ee6ff3c92b9b00e27e9df6edd246/image.png)
![image](uploads/0784599871152726fca92ec0256e85bc/image.png)
## Add your user to the sudoers group
```bash
su -
```
```bash
usermod -aG sudo <username>
```
Shut down the VM
## Allow your VM to connect to the plugged-in CyDAQ on your PC.
In VirtualBox Manager, navigate to your VMs settings again and go to the network tab. Select `Adapter 2` and enable the following settings.
- Enable Network Adapter
- Attached to: Host-only Adapter
- Name: VirtualBox Host-Only Ethernet Adapter ![image](uploads/2c0ca35e18c515a4a4604813441ce58b/image.png)
> Note: Take note of the MAC Address under `Advanced` in that page. You will need it later.
Click `OK` and power back on the VM
## Run updates
```bash
sudo apt update && sudo apt upgrade -y
```
> Note: If you get an error like
![image](uploads/eb4d3fab041cebcf1466b2b4a3f360db/image.png)
comment out the last three lines of '/etc/apt/apt.conf.d/50appstream' like so
![image](uploads/2a04ab4c828449ffcdabdbee3581364b/image.png) __**If you ran into this error, you do need to re-run the above update commands as the update did not properly finish!**__
## Configure your ARP table to resolve the CyDAQ's IP address to the correct interface.
```bash
sudo apt install net-tools
```
Ping the CyDAQ and wait for it to time out (this step is needed to populate the arp table)
```bash
ping 169.254.7.2
```
> Note: You will need to ctrl + c to stop the ping once you see a few error messages
```bash
sudo arp -s 169.254.7.2 <mac address from earlier>
```
For example, mine was
```bash
sudo arp -s 169.254.7.2 08:00:27:4c:ec:f2
```
To verify that it's working correctly, connect a CyDAQ to your PC (with the correct firmware installed) and ping it.
```bash
ping 169.254.7.2
```
**Note**: if it is not working (a.k.a. not returning a ping from 169.254.7.2).
1. Open up the device manager.
2. Unplug your cords and plug them back in noting what USB Serial Devices and Ports disappeared and came back. (There should be 2)
3. Disable and Enable the devices.
This should have allowed your VM to pick them up instead of your windows machine. If not keep trying until it does and cry.
## Next steps
You are now ready to install [Vivado/Vitis](https://git.ece.iastate.edu/sd/sdmay23-47/-/wikis/Vivado-and-Vitis-Install) and [Petalinux tools](https://git.ece.iastate.edu/sd/sdmay23-47/-/wikis/Petalinux-Tools-Install)!
[Next Chapter >>](Petalinux-Tools-Install)
\ No newline at end of file