Skip to content

Commit 30d50a8

Browse files
authored
Merge pull request #64 from bitcraze/krichardsson/ubuntu-22-04
Use Ubuntu 22.04
2 parents 69ec306 + fac0405 commit 30d50a8

19 files changed

+409
-397
lines changed

README.md

+27-20
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,59 @@ The Bitcraze VM contains everything you need for running the Bitcraze projects a
77

88
Here is a non-exhaustive list of what's included:
99

10-
* Xubuntu 20.04 pre-configured
10+
* Ubuntu live server 22.04 pre-configured
1111
* VirtualBox guest additions pre-installed
1212
* udev rules and pre-configured USB filtering for the Crazyradio and it's bootloader (NRF BOOT)
1313
* Most of our projects pre-cloned
1414
* QTCreator
1515
* Firefox
16-
* KiCad
1716
* vscode prepared for compiling/debugging/flashing the Crazyflie firmware
1817
* SDCC 3.2 for compiling of Crazyradio firmware
1918

2019

21-
Downloading
22-
-----------
20+
## Downloading
21+
2322
The Bitcraze VM can be downloaded via the [Github Release Page](https://github.com/bitcraze/bitcraze-vm/releases)
2423

25-
Installing
26-
----------
27-
The virtual appliance can be imported into [VirtualBox](https://www.virtualbox.org/ "VirtualBox"). You will need the extention package of virtual box to be able to use the USB device. Go to [Oracles download page](https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html?msclkid=be59f68fcf9f11ec801dcf4ea944dd1d) to install both virtual box and the expansion pack.
24+
## Installing
25+
26+
The virtual appliance can be imported into [VirtualBox](https://www.virtualbox.org/ "VirtualBox"). You will need the
27+
extention package of virtual box to be able to use the USB device. Go to
28+
[Oracles download page](https://www.oracle.com/virtualization/technologies/vm/downloads/virtualbox-downloads.html?msclkid=be59f68fcf9f11ec801dcf4ea944dd1d)
29+
to install both virtual box and the expansion pack.
2830

29-
It can be used with other virtual machine manager however setting up the guest addition might be required. The following have been tested
31+
It can be used with other virtual machine managers, however setting up the guest addition might be required. The
32+
following have been tested
3033

3134
* [Gnome Boxes](https://wiki.gnome.org/Apps/Boxes)
3235
* [VM Player](http://www.vmware.com/products/player/ "WM Player")
3336

34-
Using the virtual machine
35-
-------------------------
36-
After importing just run the machine. It logs in automatically but use the following credentials if needed:
37+
## Using the virtual machine
38+
39+
After importing just run the machine. Log in with the following credentials:
3740
```
3841
User: bitcraze
3942
Pass: crazyflie
4043
```
4144

42-
In the virtual machine double click the **“update all projects”** icon on the desktop. This pulls down the latest source code from GitHub for all projects.
45+
In the virtual machine double click the **“update all projects”** icon on the desktop. This pulls down the latest source
46+
code from GitHub for all projects.
4347

44-
install hardware
45-
-------------------------
48+
## install hardware
4649

4750
Insert Crazyradio PA in a USB port.
4851
Insert game controller in a USB port.
4952

50-
Optimizing for Use
51-
-------------------------
52-
For faster USB connection with the Crazyradio PA it is advised to filter the USB device at startup of the VM. Go to *settings->USB*, make sure that USB 3.0 is enabled and add a USB device filter for the Crazyflie PA, which should be called 'Bitcraze Crazyradio PA USB Dongle [9955]'.
53+
## Optimizing for Use
5354

54-
Also just to be sure, install the guest addition pack from inside the VM by typing:
55-
`sudo apt-get install virtualbox-guest-additions-iso`
55+
For faster USB connection with the Crazyradio PA it is advised to filter the USB device at startup of the VM. Go to
56+
*settings->USB*, make sure that USB 3.0 is enabled and add a USB device filter for the Crazyflie PA, which should be
57+
called 'Bitcraze Crazyradio PA USB Dongle [9955]'.
5658

57-
For the rest of the performance of your VM, you can try to increase the base memory (Settings/System/Motherboard), the CPU's available (Settings/System/Processor), enable hardware acceleration and select Hyper-V (Settings/System/Acceleration) or increase the video memory with 3D acceleration enabled (Settings/Display/Screen). This requires some adjusting as this could be different per system you are running the VM from.
59+
For the rest of the performance of your VM, you can try to increase the base memory (Settings/System/Motherboard), the
60+
CPU's available (Settings/System/Processor), enable hardware acceleration and select Hyper-V (Settings/System/Acceleration)
61+
or increase the video memory with 3D acceleration enabled (Settings/Display/Screen). This requires some adjusting as
62+
this could be different per system you are running the VM from.
5863

5964
# How to build the Bitcraze VM image
6065

@@ -70,6 +75,8 @@ For the rest of the performance of your VM, you can try to increase the base mem
7075
1. Run ```createBitcrazeVM.sh```
7176
2. Wait 40-60 minutes depending on machine and internet connection speed
7277

78+
The resulting .ova can be found in `output-virtualbox-ovf/BitcrazeVM.ova`.
79+
7380
### What does createBitcrazeVM.sh do?
7481
Run the two [Packer](https://www.packer.io) templates
7582
* Create the VM and run a preseeded installation (```bitcrazeVM_createVM.json```)

bitcrazeVM_createVM.json

+43-32
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,59 @@
22
"builders": [
33
{
44
"boot_command": [
5-
"<esc><wait>",
6-
"install auto=true priority=critical url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
7-
"<enter><wait>"
5+
"<esc><esc><esc><esc>e<wait>",
6+
"<del><del><del><del><del><del><del><del>",
7+
"<del><del><del><del><del><del><del><del>",
8+
"<del><del><del><del><del><del><del><del>",
9+
"<del><del><del><del><del><del><del><del>",
10+
"<del><del><del><del><del><del><del><del>",
11+
"<del><del><del><del><del><del><del><del>",
12+
"<del><del><del><del><del><del><del><del>",
13+
"<del><del><del><del><del><del><del><del>",
14+
"<del><del><del><del><del><del><del><del>",
15+
"<del><del><del><del><del><del><del><del>",
16+
"<del><del><del><del><del><del><del><del>",
17+
"<del><del><del><del><del><del><del><del>",
18+
"<del><del><del><del><del><del><del><del>",
19+
"<del><del><del><del><del><del><del><del>",
20+
"<del><del><del><del><del><del><del><del>",
21+
"linux /casper/vmlinuz --- autoinstall ds=\"nocloud-net;seedfrom=http://{{.HTTPIP}}:{{.HTTPPort}}/\"<enter><wait>",
22+
"initrd /casper/initrd<enter><wait>",
23+
"boot<enter>",
24+
"<enter><f10><wait>"
825
],
926
"boot_wait": "4s",
10-
"disk_size": "30000",
27+
"memory": "2048",
28+
"cpus": "2",
29+
"disk_size": "40000",
1130
"format": "ova",
1231
"guest_additions_mode": "disable",
1332
"guest_os_type": "Ubuntu_64",
1433
"hard_drive_interface": "sata",
1534
"http_directory": "http",
16-
"iso_checksum": "md5:e5bf713621b43207dead707396da29f6",
17-
"iso_url": "http://archive.ubuntu.com/ubuntu/dists/focal/main/installer-amd64/current/legacy-images/netboot/mini.iso",
35+
"iso_checksum": "sha256:a4acfda10b18da50e2ec50ccaf860d7f20b389df8765611142305c0e911d16fd",
36+
"iso_url": "https://releases.ubuntu.com/22.04/ubuntu-22.04.3-live-server-amd64.iso",
1837
"shutdown_command": "echo {{user `password`}} | sudo -S shutdown -P now",
1938
"ssh_password": "{{user `password`}}",
20-
"ssh_timeout": "10000s",
2139
"ssh_username": "{{user `user`}}",
40+
"ssh_timeout": "1h",
41+
"ssh_handshake_attempts": 420,
2242
"type": "virtualbox-iso",
43+
"virtualbox_version_file": ".vbox_version",
2344
"vboxmanage": [
24-
[
25-
"modifyvm",
26-
"{{.Name}}",
27-
"--memory",
28-
"1024",
29-
"--vram",
30-
"16",
31-
"--mouse",
32-
"usbtablet",
33-
"--rtcuseutc",
34-
"on",
35-
"--audio",
36-
"pulse",
37-
"--audiocodec",
38-
"ad1980",
39-
"--usb",
40-
"on",
41-
"--usbohci",
42-
"on",
43-
"--nestedpaging",
44-
"off"
45-
],
45+
["modifyvm", "{{.Name}}", "--audio", "pulse"],
46+
["modifyvm", "{{.Name}}", "--audiocodec", "ad1980"],
47+
["modifyvm", "{{.Name}}", "--usb", "on"],
48+
["modifyvm", "{{.Name}}", "--usb-xhci", "on"],
49+
["modifyvm", "{{.Name}}", "--vrde", "off"],
50+
["modifyvm", "{{.Name}}", "--nictype1", "virtio"],
51+
["modifyvm", "{{.Name}}", "--memory", "2048"],
52+
["modifyvm", "{{.Name}}", "--cpus", "2"],
53+
["modifyvm", "{{.Name}}", "--vram", "64"],
54+
["modifyvm", "{{.Name}}", "--graphicscontroller", "vmsvga"],
55+
["modifyvm", "{{.Name}}", "--mouse", "usbtablet"],
56+
["modifyvm", "{{.Name}}", "--nestedpaging", "off"],
57+
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
4658
[
4759
"storageattach",
4860
"{{.Name}}",
@@ -54,9 +66,8 @@
5466
"on",
5567
"--discard",
5668
"on"
57-
],
58-
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"]
59-
],
69+
]
70+
],
6071
"vboxmanage_post": [
6172
[
6273
"modifyhd",

bitcrazeVM_provisionVM.json

+23-52
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,19 @@
1111
"ssh_username": "{{user `user`}}",
1212
"type": "virtualbox-ovf",
1313
"vboxmanage": [
14-
[
15-
"modifyvm",
16-
"{{.Name}}",
17-
"--cpus",
18-
"2",
19-
"--memory",
20-
"2048",
21-
"--vram",
22-
"16",
23-
"--mouse",
24-
"usbtablet",
25-
"--rtcuseutc",
26-
"on",
27-
"--audio",
28-
"pulse",
29-
"--audiocodec",
30-
"ad1980",
31-
"--usb",
32-
"on",
33-
"--usbxhci",
34-
"on",
35-
"--nestedpaging",
36-
"off",
37-
"--graphicscontroller",
38-
"vmsvga"
39-
],
14+
["modifyvm", "{{.Name}}", "--audio", "pulse"],
15+
["modifyvm", "{{.Name}}", "--audiocodec", "ad1980"],
16+
["modifyvm", "{{.Name}}", "--usb", "on"],
17+
["modifyvm", "{{.Name}}", "--usb-xhci", "on"],
18+
["modifyvm", "{{.Name}}", "--vrde", "off"],
19+
["modifyvm", "{{.Name}}", "--nictype1", "virtio"],
20+
["modifyvm", "{{.Name}}", "--memory", "2048"],
21+
["modifyvm", "{{.Name}}", "--cpus", "2"],
22+
["modifyvm", "{{.Name}}", "--vram", "64"],
23+
["modifyvm", "{{.Name}}", "--graphicscontroller", "vmsvga"],
24+
["modifyvm", "{{.Name}}", "--mouse", "usbtablet"],
25+
["modifyvm", "{{.Name}}", "--nestedpaging", "off"],
26+
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"],
4027
[
4128
"storageattach",
4229
"{{.Name}}",
@@ -48,52 +35,36 @@
4835
"on",
4936
"--discard",
5037
"on"
51-
],
52-
["modifyvm", "{{.Name}}", "--nat-localhostreachable1", "on"]
38+
]
5339
],
5440
"virtualbox_version_file": ".vbox_version",
5541
"vm_name": "{{user `vm-name`}}"
5642
}
5743
],
5844
"provisioners": [
5945
{
60-
"destination": "/home/bitcraze/update_all_projects.sh",
6146
"source": "{{user `contentDir`}}/update_all_projects.sh",
47+
"destination": "/home/bitcraze/update_all_projects.sh",
6248
"type": "file"
6349
},
6450
{
65-
"destination": "/home/bitcraze/Desktop",
66-
"source": "{{user `contentDir`}}/desktop/",
67-
"type": "file"
68-
},
69-
{
70-
"destination": "/home/bitcraze/Pictures",
71-
"source": "{{user `contentDir`}}/pictures/",
72-
"type": "file"
73-
},
74-
{
75-
"destination": "/home/bitcraze/{{user `gccFile`}}",
76-
"source": "{{user `contentDir`}}/{{user `gccFile`}}",
77-
"type": "file"
78-
},
79-
{
80-
"destination": "/home/bitcraze/{{user `eclipseFile`}}",
81-
"source": "{{user `contentDir`}}/{{user `eclipseFile`}}",
51+
"source": "{{user `contentDir`}}/Desktop",
52+
"destination": "/home/bitcraze",
8253
"type": "file"
8354
},
8455
{
85-
"destination": "/home/bitcraze/{{user `eclipsePrj`}}",
86-
"source": "{{user `contentDir`}}/{{user `eclipsePrj`}}",
56+
"source": "{{user `contentDir`}}/Pictures",
57+
"destination": "/home/bitcraze",
8758
"type": "file"
8859
},
8960
{
90-
"destination": "/home/bitcraze/{{user `openocd`}}",
91-
"source": "{{user `contentDir`}}/{{user `openocd`}}",
92-
"type": "file"
61+
"execute_command": "echo '{{user `password`}}' | {{ .Vars }} sh '{{ .Path }}'",
62+
"script": "provision.sh",
63+
"type": "shell"
9364
},
9465
{
9566
"execute_command": "echo '{{user `password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
96-
"script": "provision.sh",
67+
"script": "provision-sudo.sh",
9768
"type": "shell"
9869
}
9970
],

contentForVM/desktop/README.txt renamed to contentForVM/Desktop/README.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,17 @@ The virtual machine
1414
* The username is: bitcraze
1515
* The password is: crazyflie
1616
* The virtual machine has 30GB drive and 2 GB of RAM
17-
* The virtual machine is using Xubuntu 20.04 LTS Core (minimal) install.
17+
* The virtual machine is using Ubuntu Live Server 22.04 LTS install.
1818

1919
Installed software
2020
------------------
2121
Here is a non-exhaustive list of what's included:
22-
* Xubuntu 20.04 pre-configured
22+
* Ubuntu 22.04 pre-configured
2323
* VirtualBox guest additions pre-installed
2424
* udev rules and pre-configured USB filtering for the Crazyradio and it's bootloader (NRF BOOT)
2525
* Most of our projects pre-cloned
2626
* QTCreator
2727
* Firefox
28-
* KiCad
2928
* vscode prepared for compiling/debugging/flashing the Crazyflie firmware
3029
* SDCC 3.2 for compiling of Crazyradio firmware
3130

@@ -35,7 +34,7 @@ repos: https://github.com/bitcraze/bitcraze-vm/tree/master/provision.sh
3534

3635
Projects
3736
--------
38-
The following projects have been pre-cloned into the /home/bitcraze/projects
37+
The following projects have been pre-cloned into the /home/bitcraze/projects
3938
directory:
4039
* crazyflie-pc-client
4140
* crazyflie-firmware

contentForVM/desktop/code.desktop renamed to contentForVM/Desktop/code.desktop

+5-10
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@
22
Name=Visual Studio Code
33
Comment=Code Editing. Redefined.
44
GenericName=Text Editor
5-
Exec=/usr/share/code/code --no-sandbox --unity-launch %F
6-
Icon=/usr/share/pixmaps/com.visualstudio.code.png
5+
Exec=code --force-user-env --unity-launch %F
6+
Icon=/snap/code/current/meta/gui/vscode.png
77
Type=Application
88
StartupNotify=false
99
StartupWMClass=Code
10-
Categories=Utility;TextEditor;Development;IDE;
10+
Categories=TextEditor;Development;IDE;
1111
MimeType=text/plain;inode/directory;application/x-code-workspace;
1212
Actions=new-empty-window;
1313
Keywords=vscode;
1414

15-
X-Desktop-File-Install-Version=0.24
16-
17-
Path=
18-
Terminal=false
19-
2015
[Desktop Action new-empty-window]
2116
Name=New Empty Window
22-
Exec=/usr/share/code/code --no-sandbox --new-window %F
23-
Icon=com.visualstudio.code
17+
Exec=code --force-user-env --new-window %F
18+
Icon=/snap/code/current/meta/gui/vscode.png
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[Desktop Entry]
2+
Name=Terminal
3+
Comment=Use the command line
4+
Keywords=shell;prompt;command;commandline;cmd;
5+
TryExec=gnome-terminal
6+
Exec=gnome-terminal
7+
Icon=org.gnome.Terminal
8+
Type=Application
9+
Categories=GNOME;GTK;System;TerminalEmulator;
10+
StartupNotify=true
11+
StartupWMClass=Gnome-terminal
12+
SingleMainWindow=false
13+
OnlyShowIn=GNOME;Unity;
14+
Actions=new-window;preferences;
15+
X-ExecArg=--
16+
X-Ubuntu-Gettext-Domain=gnome-terminal
17+
18+
[Desktop Action new-window]
19+
Name=New Window
20+
Exec=gnome-terminal --window
21+
22+
[Desktop Action preferences]
23+
Name=Preferences
24+
Exec=gnome-terminal --preferences

0 commit comments

Comments
 (0)