@@ -165,6 +165,46 @@ Note that when attached to a VM's desktop (`vmattach` command), ctrl+F12 toggles
`nexus-cli` is another **nexus-client** in the form of a single native executable featuring pretty much the exact same commands as `nexush`. Therefore we won't list them here.
## USB redirection
USB redirection allows USB devices plugged in the PC running nexus client to be accessible in the guest OS of the VM running on the server.
When creating a new VM with `vmcreate`, you can specify USB devices that are accessible in the VM. A USB device is specified by two hexadecimal number, a vendor ID (`VID`) and a product ID (`PID`). For instance, the example below creates a VM and allows two USB devices, 067b:2303 (a USB/serial connector) and 0781:5567 (a SanDisk USB key) to be accessible in the VM:
To obtain the vendor ID and product ID of a USB device, run the `lsusb` command on Linux. The output should be similar to the one below, where the sixth column indicates vendor ID and product ID separated by a colon (`:`):
```
Bus 003 Device 026: ID 04d8:0b27 Microchip Technology, Inc. USB2734
Bus 003 Device 003: ID 0b0e:245d GN Netcom Jabra Link 370
Bus 003 Device 009: ID 058f:6362 Alcor Micro Corp. Flash Card Reader/Writer
Bus 003 Device 006: ID 046d:08e3 Logitech, Inc. C505 HD Webcam
```
### Vendor ID and product ID of USB devices of interest
| Device description | VID:PID |
|--- |--- |
| Atmel at91sam SAMBA bootloader | 03eb:6124 |
| Prolific Technology USB/serial | 067b:2303 |
| MyLab2 serial port | 0403:6015 |
| Digilent Analog Discovery 2 | 0403:6014 |
| NXP CMSIS-DAP | 1fc9:001d |
| Saleae Logic Pro 16 | 21a9:1006 |
| Peak USB CAN | 0c72:000c |
| Segger J-Link | 1366:0101 |
| Xilinx KV260 and KR260 JTAG and UART | 0403:6011 |
| Xilinx Nexys Video JTAG | 0403:6010 |
| Xilinx Nexys Video UART | 0403:6001 |
| USBest Technology USB key | 1307:0165 |
| SanDisk Cruzer Blade USB key | 0781:5567 |
## nexush usage examples
Launch `nexush` and log in as user `janedoe@nexus.org` (note that you will be prompted for your password):
...
...
@@ -248,14 +288,14 @@ Kill VM `6713ce26-941e-4d95-8e92-6b71d44bf75a`:
vmkill 6713ce26-941e-4d95-8e92-6b71d44bf75a
```
Create a VM named "Doom", based on the `fbccb584-9ea6-40f7-926d-dabf3970525e` (Doom) template, with 4 CPUs, 4GB RAM, and a network interface with NAT translation:
Create a VM named "Doom", based on the `fbccb584-9ea6-40f7-926d-dabf3970525e` (Doom) template, with 4 CPUs, 4GB RAM, a network interface with NAT translation, and no USB devices:
```
vmcreate Doom 4 4096 user fbccb584-9ea6-40f7-926d-dabf3970525e
vmcreate Doom 4 4096 user none fbccb584-9ea6-40f7-926d-dabf3970525e
```
Create 50 VMs with the base name "ISC_433 Exam" based on the `6713ce26-941e-4d95-8e92-6b71d44bf75a` template, with 2 CPUs, 2GB RAM, and no network interface:
Create 50 VMs with the base name "ISC_433 Exam" based on the `6713ce26-941e-4d95-8e92-6b71d44bf75a` template, with 2 CPUs, 2GB RAM, no network interface, and no USB devices:
Edit VMs matching the "PCO lab2" pattern by changing their CPU to 1 core and a network interface with NAT translation (`user`):
Edit VMs matching the "PCO lab2" pattern by changing their CPU to 1 core, a network interface with NAT translation (`user`), and adding access to USB devices baba:0007 and 1234:abcd:
@@ -425,7 +465,7 @@ First, you need to create the VM that will be used by the students during the ex
1. Create the VM based on the chosen template. Let's say you want the VM to be named "Exam ProgSys Oct2022" and you want it to have 2 CPUs, 3GB RAM and access to the Internet (for now):
```
vmcreate "Exam ProgSys Oct2022" 2 3000 user effefb49-0402-4095-a42d-1755937fe4b1
vmcreate "Exam ProgSys Oct2022" 2 3000 user none effefb49-0402-4095-a42d-1755937fe4b1
```
This command displays the name and ID of the created VM(s):
```
...
...
@@ -482,7 +522,7 @@ First, you need to create the VM that will be used by the students during the ex
1. You can now create the VMs for your 30 students using your new template (ID `0fb0b1f2-c72c-416e-961a-6bb802da89bb`). Let's say the base name for the 30 VMs to create is "Live Exam ProgSys Oct2022". You want the VMs to have: 2 CPUs, 3GB RAM and no network interface to prevent any fraud. Create a CSV file, say `students.csv` with the names of your 30 students, one per line. Then, create the 30 VMs with: