Adding file naming and indexing
[AGL/documentation.git] / docs / 1_Getting_Started / 1_Quickstart / 1_Using_Ready_Made_Images.md
1 ---
2 title: Using Ready Made Images
3 ---
4
5 AGL provides a number of pre-built ready-made images of various versions.
6
7 ## x86 (Emulation and Hardware)
8
9 ### 1. QEMU (Emulation)
10
11 1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemux86-64/deploy/images/qemux86-64/agl-demo-platform-crosssdk-qemux86-64.ext4.xz).
12
13 2. Download the [compressed kernel image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemux86-64/deploy/images/qemux86-64/bzImage).
14
15 3. Install [QEMU](https://www.qemu.org/download/) :
16
17     ```sh
18     $ apt-get install qemu
19     ```
20
21 4. Install [vinagre](https://wiki.gnome.org/Apps/Vinagre) :
22
23     ```sh
24     $ sudo apt install vinagre
25     ```
26
27 5. Create boot directory and copy compressed images (prebuilt & kernel) into them :
28
29     ```sh
30     $ mkdir ~/agl-demo/
31     $ cp ~/Downloads/agl-demo-platform-crosssdk-qemux86-64.ext4.xz ~/agl-demo/
32     $ cp ~/Downloads/bzImage ~/agl-demo/
33     $ cd ~/agl-demo
34     $ sync
35     ```
36
37 6. Extract prebuilt compressed image :
38
39     ```sh
40     $ xz -v -d agl-demo-platform-crosssdk-qemux86-64.ext4.xz
41     ```
42
43 7. Launch QEMU with vinagre (for scaling), remove `- snapshot \` if you want to save changes to the image files :
44
45   ```sh
46     $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
47     $ qemu-system-x86_64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 -netdev user,id=net0,hostfwd=tcp::2222-:22 \
48       -drive file=agl-demo-platform-crosssdk-qemux86-64.ext4,if=virtio,format=raw -show-cursor -usb -usbdevice tablet -device virtio-rng-pci \
49       -snapshot -vga virtio \
50       -vnc :0 -soundhw hda -machine q35 -cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt -enable-kvm \
51       -m 2048 -serial mon:vc -serial mon:stdio -serial null -kernel bzImage \
52       -append 'root=/dev/vda rw console=tty0 mem=2048M ip=dhcp oprofile.timer=1 console=ttyS0,115200n8 verbose fstab=no'
53   ```
54
55   - Login into AGL :
56
57     ```sh
58     Automotive Grade Linux 11.0.0+snapshot qemux86-64 ttyS1
59
60     qemux86-64 login: root
61     ```
62
63
64   - Shutdown QEMU : `$ poweroff`, otherwise QEMU will run in the background.
65   - To use vnc-viewer instead of vinagre :
66     ```sh
67     $ ( sleep 5 && vncviewer ) &
68        qemu-system-x86_64 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:35:02 -netdev user,id=net0,hostfwd=tcp::2222-:22 \
69        -drive file=agl-demo-platform-crosssdk-qemux86-64.ext4,if=virtio,format=raw -show-cursor -usb -usbdevice tablet -device virtio-rng-pci \
70        -snapshot -vga virtio \
71        -vnc :0 -soundhw hda -machine q35 -cpu kvm64 -cpu qemu64,+ssse3,+sse4.1,+sse4.2,+popcnt -enable-kvm \
72        -m 2048 -serial mon:vc -serial mon:stdio -serial null -kernel bzImage \
73        -append 'root=/dev/vda rw console=tty0 mem=2048M ip=dhcp oprofile.timer=1 console=ttyS0,115200n8 verbose fstab=no'
74     ```
75
76 ### 2. Virtual Box (Emulation)
77
78 **NOTE :** Please note [https://www.virtualbox.org/ticket/19873](https://www.virtualbox.org/ticket/19873) as this affects the VMs resolution.
79 The AGL demo images do require 1920x1080. The instructions below have been adapted.
80
81   1. Download the [compressed vbox disk image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemux86-64/deploy/images/qemux86-64/agl-demo-platform-crosssdk-qemux86-64.wic.vmdk.xz).
82
83   2. Install and set up [Virtual Box](https://www.virtualbox.org/wiki/Linux_Downloads).
84
85   3. Extract the vmdk file : `$ xz -v -d agl-demo-platform-crosssdk-qemux86-64.wic.vmdk.xz`
86
87   4. Configure virtual box for AGL :
88     - Click on `New` or `Add`.
89     - Enter Name as `agl-demo`.
90     - Type as `Linux`.
91     - Version as `Other Linux (64-bit)`, click on `Next`.
92     ![vbox-step-1](images/vbox-1.png)
93     - Select Memory size. Recommended is `2048 MB`, click on `Next`.
94     ![vbox-step-2](images/vbox-2.png)
95     - Click on `Use an existing virtual hard disk file`, and select the extracted `agl-demo-platform-crosssdk-qemux86-64.wic.vmdk` file, click on `Create`.
96     ![vbox-step-3](images/vbox-3.png)
97     - Go to `Settings`, and into `System`. Select `Chipset : IHC9`. Check on `Enable EFI (special OSes only)` and click on `OK`.
98     ![vbox-step-4](images/vbox-4.png)
99     - Go to `Storage`, and change the attribute to `Type : AHCI` and click on `OK`.
100     ![vbox-step-5](images/vbox-5.png)
101     - Next go to `Display` and change the attribute to 'VMSVGA' for the graphics driver. Change the graphics memory to be at least 64MB.
102     - **Important:**: Open a new terminal window and execute this command:
103     ```sh
104     VBoxManage setextradata agl-demo VBoxInternal2/EfiGraphicsResolution 1920x1080
105     ```
106     - Return to the UI and click on `Start`.
107     - For troubleshooting, you can refer [here](https://lists.automotivelinux.org/g/agl-dev-community/message/8474).
108
109 ### 3. x86 physical system
110
111   **NOTE :** UEFI enabled system is required.
112
113   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemux86-64/deploy/images/qemux86-64/agl-demo-platform-crosssdk-qemux86-64.wic.xz).
114
115   2. Extract the image into USB drive :
116
117      ```sh
118      $ lsblk
119      $ sudo umount <usb_device_name>
120      $ xzcat agl-demo-platform-crosssdk-qemux86-64.wic.xz | sudo dd of=<usb_device_name> bs=4M
121      $ sync
122      ```
123
124
125   3. Boot from USB drive on the x86 system.
126
127 ## ARM 32 bit (Emulation and Hardware)
128
129 ### 1. QEMU (Emulation)
130
131 1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemuarm/deploy/images/qemuarm/agl-demo-platform-crosssdk-qemuarm.ext4.xz).
132
133 2. Download the [compressed kernel image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemuarm/deploy/images/qemuarm/zImage).
134
135 3. Install [QEMU](https://www.qemu.org/download/) :
136
137     ```sh
138     $ apt-get install qemu
139     ```
140
141 4. Install [vinagre](https://wiki.gnome.org/Apps/Vinagre) :
142
143     ```sh
144     $ sudo apt install vinagre
145     ```
146
147 5. Create boot directory and copy compressed images (prebuilt & kernel) into them :
148
149     ```sh
150     $ mkdir ~/agl-demo/
151     $ cp ~/Downloads/agl-demo-platform-crosssdk-qemuarm.ext4.xz ~/agl-demo/
152     $ cp ~/Downloads/zImage ~/agl-demo/
153     $ cd ~/agl-demo
154     $ sync
155     ```
156
157 6. Extract prebuilt compressed image :
158
159     ```sh
160     $ xz -v -d agl-demo-platform-crosssdk-qemuarm.ext4.xz
161     ```
162
163 7. Launch QEMU with vinagre (for scaling), remove `- snapshot` if you want to save changes to the image files :
164
165   ```sh
166     $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
167         qemu-system-arm -cpu cortex-a15 -machine virt-2.11 -nographic \
168         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
169         -net user -m 2048 -monitor none -soundhw hda -device usb-ehci \
170         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on -vnc :0 \
171         -device qemu-xhci -device usb-tablet -device usb-kbd \
172         -kernel zImage -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false" \
173         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm.ext4 \
174         -snapshot
175   ```
176
177   - Login into AGL :
178
179     ```sh
180     Automotive Grade Linux 11.0.0+snapshot qemux86-64 ttyS1
181
182     qemux86-64 login: root
183     ```
184
185
186   - Shutdown QEMU : `$ poweroff`, otherwise QEMU will run in the background.
187   - To use vnc-viewer instead of vinagre :
188     ```sh
189     $ ( sleep 5 && vncviewer ) &
190         qemu-system-arm -cpu cortex-a15 -machine virt-2.11 -nographic \
191         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
192         -net user -m 2048 -monitor none -soundhw hda -device usb-ehci \
193         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on -vnc :0 \
194         -device qemu-xhci -device usb-tablet -device usb-kbd \
195         -kernel zImage -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false" \
196         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm.ext4 \
197         -snapshot
198     ```
199
200 ### 2. BeagleBone Enhanced (BBE)
201
202   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/bbe/deploy/images/bbe/agl-demo-platform-crosssdk-bbe.wic.xz).
203
204   2. Extract the image into the SD card of BeagleBone Enhanced :
205
206     ```sh
207     $ lsblk
208     $ sudo umount <sdcard_device_name>
209     $ xzcat agl-demo-platform-crosssdk-bbe.wic.xz | sudo dd of=<sdcard_device_name> bs=4M
210     $ sync
211     ```
212
213     **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
214         be sure you are actually writing to the removable MicroSD card and not some other
215         device.
216         Each computer is different and removable devices can change from time to time.
217         Consequently, you should repeat the previous operation with the MicroSD card to
218         confirm the device name every time you write to the card.
219
220       To summarize this example so far, we have the following:
221         The first SATA drive is `/dev/sda` and `/dev/sdc` corresponds to the MicroSD card, and is also marked as a removable device.You can see this in the output of the `lsblk` command where "1" appears in the "RM" column for that device.
222
223 ## AARCH64 - ARM 64bit
224
225 ### 1. QEMU (Emulation)
226
227 1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemuarm64/deploy/images/qemuarm64/agl-demo-platform-crosssdk-qemuarm64.ext4.xz).
228
229 2. Download the [compressed kernel image](https://download.automotivelinux.org/AGL/snapshots/master/latest/qemuarm64/deploy/images/qemuarm64/Image).
230
231 3. Install [QEMU](https://www.qemu.org/download/) :
232
233     ```sh
234     $ apt-get install qemu
235     ```
236
237 4. Install [vinagre](https://wiki.gnome.org/Apps/Vinagre) :
238
239     ```sh
240     $ sudo apt install vinagre
241     ```
242
243 5. Create boot directory and copy compressed images (prebuilt & kernel) into them :
244
245     ```sh
246     $ mkdir ~/agl-demo/
247     $ cp ~/Downloads/agl-demo-platform-crosssdk-qemuarm64.ext4.xz ~/agl-demo/
248     $ cp ~/Downloads/zImage ~/agl-demo/
249     $ cd ~/agl-demo
250     $ sync
251     ```
252
253 6. Extract prebuilt compressed image :
254
255     ```sh
256     $ xz -v -d agl-demo-platform-crosssdk-qemuarm64.ext4.xz
257     ```
258
259 7. Launch QEMU with vinagre (for scaling), remove `- snapshot \` if you want to save changes to the image files :
260
261   ```sh
262     $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
263         qemu-system-aarch64 -cpu cortex-a57 -machine virt -nographic \
264         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
265         -net user -m 2048 -monitor none -smp 2 -soundhw hda -device usb-ehci \
266         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on \
267         -device qemu-xhci -device usb-tablet -device usb-kbd -vnc :0 \
268         -kernel Image -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false " \
269         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm64.ext4 \
270         -snapshot
271   ```
272
273   - Login into AGL :
274
275     ```sh
276     Automotive Grade Linux 11.0.0+snapshot qemux86-64 ttyS1
277
278     qemux86-64 login: root
279     ```
280
281
282   - Shutdown QEMU : `$ poweroff`, otherwise QEMU will run in the background.
283   - To use vnc-viewer instead of vinagre :
284     ```sh
285     $ ( sleep 5 && vncviewer ) &
286         qemu-system-aarch64 -cpu cortex-a57 -machine virt -nographic \
287         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
288         -net user -m 2048 -monitor none -smp 2 -soundhw hda -device usb-ehci \
289         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on \
290         -device qemu-xhci -device usb-tablet -device usb-kbd -vnc :0 \
291         -kernel Image -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false " \
292         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm64.ext4 \
293         -snapshot
294     ```
295
296 ### 2. Raspberry Pi 4
297
298   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/raspberrypi4/deploy/images/raspberrypi4-64/agl-demo-platform-crosssdk-raspberrypi4-64.wic.xz).
299
300   2. Extract the image into the SD card of Raspberry Pi 4 :
301
302     ```sh
303     $ lsblk
304     $ sudo umount <sdcard_device_name>
305     $ xzcat agl-demo-platform-crosssdk-raspberrypi4-64.wic.xz | sudo dd of=<sdcard_device_name> bs=4M
306     $ sync
307     ```
308
309     **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
310         be sure you are actually writing to the removable MicroSD card and not some other
311         device.
312         Each computer is different and removable devices can change from time to time.
313         Consequently, you should repeat the previous operation with the MicroSD card to
314         confirm the device name every time you write to the card.
315
316       To summarize this example so far, we have the following:
317         The first SATA drive is `/dev/sda` and `/dev/sdc` corresponds to the MicroSD card, and is also marked as a removable device.You can see this in the output of the `lsblk` command where "1" appears in the "RM" column for that device.
318
319   3. SSH into Raspberry Pi :
320     - Connect Raspberry Pi to network : `Homescreen > Settings`, IP address mentioned here.
321     - `ssh root@<Raspberry-Pi-ip-address>`
322
323
324   4. Serial Debugging :
325
326     When things go wrong, you can take steps to debug your Raspberry Pi.
327     For debugging, you need a 3.3 Volt USB Serial cable to fascilitate
328     communication between your Raspberry Pi board and your build host.
329
330     You can reference the following diagram for information on the following steps:
331
332     ![](images/RaspberryPi2-ModelB-debug-serial-cable.png)
333
334     1. Connect the TTL cable to the Universal Asynchronous Receiver-Transmitter
335       (UART) connection on your Raspberry Pi board.
336       Do not connect the USB side of the cable to your build host at this time.
337
338           **CAUTION:** No warranty is provided using the following procedure.
339           Pay particular attention to the collors of your cable as they could
340           vary depending on the vendor.
341
342     2. Connect the cable's BLUE wire to pin 6 (i.e. Ground) of the UART.
343
344     3. Connect the able's GREEN RX line to pin 8 (i.e. the TXD line) of
345       the UART.
346
347     4. Connect the cable's RED TX line to pin 10 (i.e. the RXD line) of
348       the UART.
349
350     5. Plug the USB connector of the cable into your build host's USB port.
351
352     6. Use your favorite tool for serial communication between your build host
353       and your Raspberry Pi.
354       For example, if your build host is a native Linux machine (e.g. Ubuntu)
355       you could use `screen` as follows from a terminal on the build host:
356
357       ```sh
358       $ sudo screen /dev/ttyUSB0 115200
359       ```
360
361 ### 3. R-Car H3SK (H3ULCB board)
362
363 **NOTE :** The prebuilt image does support **non-accelerated** graphics mode (software rendering). For **accelerated** graphics support, a local build with the neccesary graphics driver is required.
364
365
366   1. Update the [firmware](https://elinux.org/R-Car/Boards/H3SK#Flashing_firmware) using files from [here](https://download.automotivelinux.org/AGL/snapshots/master/latest/h3ulcb-nogfx/deploy/images/h3ulcb/).
367
368   2. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/snapshots/master/latest/h3ulcb-nogfx/deploy/images/h3ulcb/agl-demo-platform-crosssdk-h3ulcb.wic.xz).
369
370   3. Extract the image into the boot device :
371
372      ```sh
373      $ lsblk
374      $ sudo umount <boot_device_name>
375      $ xzcat agl-demo-platform-crosssdk-h3ulcb.wic.xz | sudo dd of=<boot_device_name> bs=4M
376      $ sync
377      ```
378
379   3. [Serial](https://elinux.org/R-Car/Boards/H3SK) into the board for debugging.
380       For example, if your build host is a native Linux machine (e.g. Ubuntu)
381       you could use `screen` as follows from a terminal on the build host:
382
383       ```sh
384       $ sudo screen /dev/ttyUSB0 115200
385       ```