fc1eb442d22e32d75f539f07a3d85ded6511324a
[AGL/documentation.git] / docs / 0_Getting_Started / 1_Quickstart / 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/release/koi/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/release/koi/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 see https://jira.automotivelinux.org/browse/SPEC-3731 .
79
80   1. Download the [compressed vbox disk image](https://download.automotivelinux.org/AGL/release/koi/latest/qemux86-64/deploy/images/qemux86-64/agl-demo-platform-crosssdk-qemux86-64.wic.vmdk.xz).
81
82   2. Install and set up [Virtual Box](https://www.virtualbox.org/wiki/Linux_Downloads).
83
84   3. Extract the vmdk file : `$ xz -v -d agl-demo-platform-crosssdk-qemux86-64.wic.vmdk.xz`
85
86   4. Configure virtual box for AGL :
87     - Click on `New` or `Add`.
88     - Enter Name as `agl-demo`.
89     - Type as `Linux`.
90     - Version as `Other Linux (64-bit)`, click on `Next`.
91     ![vbox-step-1](images/vbox-1.png)
92     - Select Memory size. Recommended is `2048 MB`, click on `Next`.
93     ![vbox-step-2](images/vbox-2.png)
94     - 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`.
95     ![vbox-step-3](images/vbox-3.png)
96     - Go to `Settings`, and into `System`. Select `Chipset : IHC9`. Check on `Enable EFI (special OSes only)` and click on `OK`.
97     ![vbox-step-4](images/vbox-4.png)
98     - Go to `Storage`, and change the attribute to `Type : AHCI` and click on `OK`.
99     ![vbox-step-5](images/vbox-5.png)
100     - Next go to `Display` and change the attribute to 'VMSVGA' for the graphics driver. Change the graphics memory to be at least 64MB.
101     - Click on `Start`.
102     - For troubleshooting, you can refer [here](https://lists.automotivelinux.org/g/agl-dev-community/message/8474).
103
104 ### 3. x86 physical system
105
106   **NOTE :** UEFI enabled system is required.
107
108   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/qemux86-64/deploy/images/qemux86-64/agl-demo-platform-crosssdk-qemux86-64.wic.xz).
109
110   2. Extract the image into USB drive :
111
112      ```sh
113      $ lsblk
114      $ sudo umount <usb_device_name>
115      $ xzcat agl-demo-platform-crosssdk-qemux86-64.wic.xz | sudo dd of=<usb_device_name> bs=4M
116      $ sync
117      ```
118
119
120   3. Boot from USB drive on the x86 system.
121
122 ## ARM 32 bit (Emulation and Hardware)
123
124 ### 1. QEMU (Emulation)
125
126 1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/qemuarm/deploy/images/qemuarm/agl-demo-platform-crosssdk-qemuarm.ext4.xz).
127
128 2. Download the [compressed kernel image](https://download.automotivelinux.org/AGL/release/koi/latest/qemuarm/deploy/images/qemuarm/zImage).
129
130 3. Install [QEMU](https://www.qemu.org/download/) :
131
132     ```sh
133     $ apt-get install qemu
134     ```
135
136 4. Install [vinagre](https://wiki.gnome.org/Apps/Vinagre) :
137
138     ```sh
139     $ sudo apt install vinagre
140     ```
141
142 5. Create boot directory and copy compressed images (prebuilt & kernel) into them :
143
144     ```sh
145     $ mkdir ~/agl-demo/
146     $ cp ~/Downloads/agl-demo-platform-crosssdk-qemuarm.ext4.xz ~/agl-demo/
147     $ cp ~/Downloads/zImage ~/agl-demo/
148     $ cd ~/agl-demo
149     $ sync
150     ```
151
152 6. Extract prebuilt compressed image :
153
154     ```sh
155     $ xz -v -d agl-demo-platform-crosssdk-qemuarm.ext4.xz
156     ```
157
158 7. Launch QEMU with vinagre (for scaling), remove `- snapshot` if you want to save changes to the image files :
159
160   ```sh
161     $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
162         qemu-system-arm -cpu cortex-a15 -machine virt-2.11 -nographic \
163         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
164         -net user -m 2048 -monitor none -soundhw hda -device usb-ehci \
165         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on -vnc :0 \
166         -device qemu-xhci -device usb-tablet -device usb-kbd \
167         -kernel zImage -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false" \
168         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm.ext4 \
169         -snapshot
170   ```
171
172   - Login into AGL :
173
174     ```sh
175     Automotive Grade Linux 11.0.0+snapshot qemux86-64 ttyS1
176
177     qemux86-64 login: root
178     ```
179
180
181   - Shutdown QEMU : `$ poweroff`, otherwise QEMU will run in the background.
182   - To use vnc-viewer instead of vinagre :
183     ```sh
184     $ ( sleep 5 && vncviewer ) &
185         qemu-system-arm -cpu cortex-a15 -machine virt-2.11 -nographic \
186         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
187         -net user -m 2048 -monitor none -soundhw hda -device usb-ehci \
188         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on -vnc :0 \
189         -device qemu-xhci -device usb-tablet -device usb-kbd \
190         -kernel zImage -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false" \
191         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm.ext4 \
192         -snapshot
193     ```
194
195 ### 2. BeagleBone Enhanced (BBE)
196
197   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/bbe/deploy/images/bbe/agl-demo-platform-crosssdk-bbe.wic.xz).
198
199   2. Extract the image into the SD card of BeagleBone Enhanced :
200
201     ```sh
202     $ lsblk
203     $ sudo umount <sdcard_device_name>
204     $ xzcat agl-demo-platform-crosssdk-bbe.wic.xz | sudo dd of=<sdcard_device_name> bs=4M
205     $ sync
206     ```
207
208     **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
209         be sure you are actually writing to the removable MicroSD card and not some other
210         device.
211         Each computer is different and removable devices can change from time to time.
212         Consequently, you should repeat the previous operation with the MicroSD card to
213         confirm the device name every time you write to the card.
214
215       To summarize this example so far, we have the following:
216         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.
217
218 ## AARCH64 - ARM 64bit
219
220 ### 1. QEMU (Emulation)
221
222 1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/qemuarm64/deploy/images/qemuarm64/agl-demo-platform-crosssdk-qemuarm64.ext4.xz).
223
224 2. Download the [compressed kernel image](https://download.automotivelinux.org/AGL/release/koi/latest/qemuarm64/deploy/images/qemuarm64/Image).
225
226 3. Install [QEMU](https://www.qemu.org/download/) :
227
228     ```sh
229     $ apt-get install qemu
230     ```
231
232 4. Install [vinagre](https://wiki.gnome.org/Apps/Vinagre) :
233
234     ```sh
235     $ sudo apt install vinagre
236     ```
237
238 5. Create boot directory and copy compressed images (prebuilt & kernel) into them :
239
240     ```sh
241     $ mkdir ~/agl-demo/
242     $ cp ~/Downloads/agl-demo-platform-crosssdk-qemuarm64.ext4.xz ~/agl-demo/
243     $ cp ~/Downloads/zImage ~/agl-demo/
244     $ cd ~/agl-demo
245     $ sync
246     ```
247
248 6. Extract prebuilt compressed image :
249
250     ```sh
251     $ xz -v -d agl-demo-platform-crosssdk-qemuarm64.ext4.xz
252     ```
253
254 7. Launch QEMU with vinagre (for scaling), remove `- snapshot \` if you want to save changes to the image files :
255
256   ```sh
257     $ ( sleep 5 && vinagre --vnc-scale localhost ) > /tmp/vinagre.log 2>&1 &
258         qemu-system-aarch64 -cpu cortex-a57 -machine virt -nographic \
259         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
260         -net user -m 2048 -monitor none -smp 2 -soundhw hda -device usb-ehci \
261         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on \
262         -device qemu-xhci -device usb-tablet -device usb-kbd -vnc :0 \
263         -kernel Image -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false " \
264         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm64.ext4 \
265         -snapshot
266   ```
267
268   - Login into AGL :
269
270     ```sh
271     Automotive Grade Linux 11.0.0+snapshot qemux86-64 ttyS1
272
273     qemux86-64 login: root
274     ```
275
276
277   - Shutdown QEMU : `$ poweroff`, otherwise QEMU will run in the background.
278   - To use vnc-viewer instead of vinagre :
279     ```sh
280     $ ( sleep 5 && vncviewer ) &
281         qemu-system-aarch64 -cpu cortex-a57 -machine virt -nographic \
282         -net nic,model=virtio,macaddr=52:54:00:12:34:58 \
283         -net user -m 2048 -monitor none -smp 2 -soundhw hda -device usb-ehci \
284         -device virtio-rng-pci -device VGA,vgamem_mb=64,edid=on \
285         -device qemu-xhci -device usb-tablet -device usb-kbd -vnc :0 \
286         -kernel Image -append "console=ttyAMA0,115200 root=/dev/vda verbose systemd.log_color=false " \
287         -drive format=raw,file=agl-demo-platform-crosssdk-qemuarm64.ext4 \
288         -snapshot
289     ```
290
291 ### 2. Raspberry Pi 4
292
293   1. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/raspberrypi4/deploy/images/raspberrypi4-64/agl-demo-platform-crosssdk-raspberrypi4-64.wic.xz).
294
295   2. Extract the image into the SD card of Raspberry Pi 4 :
296
297     ```sh
298     $ lsblk
299     $ sudo umount <sdcard_device_name>
300     $ xzcat agl-demo-platform-crosssdk-raspberrypi4-64.wic.xz | sudo dd of=<sdcard_device_name> bs=4M
301     $ sync
302     ```
303
304     **IMPORTANT NOTE:** Before re-writing any device on your Build Host, you need to
305         be sure you are actually writing to the removable MicroSD card and not some other
306         device.
307         Each computer is different and removable devices can change from time to time.
308         Consequently, you should repeat the previous operation with the MicroSD card to
309         confirm the device name every time you write to the card.
310
311       To summarize this example so far, we have the following:
312         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.
313
314   3. SSH into Raspberry Pi :
315     - Connect Raspberry Pi to network : `Homescreen > Settings`, IP address mentioned here.
316     - `ssh root@<Raspberry-Pi-ip-address>`
317
318
319   4. Serial Debugging :
320
321     When things go wrong, you can take steps to debug your Raspberry Pi.
322     For debugging, you need a 3.3 Volt USB Serial cable to fascilitate
323     communication between your Raspberry Pi board and your build host.
324
325     You can reference the following diagram for information on the following steps:
326
327     ![](images/RaspberryPi2-ModelB-debug-serial-cable.png)
328
329     1. Connect the TTL cable to the Universal Asynchronous Receiver-Transmitter
330       (UART) connection on your Raspberry Pi board.
331       Do not connect the USB side of the cable to your build host at this time.
332
333           **CAUTION:** No warranty is provided using the following procedure.
334           Pay particular attention to the collors of your cable as they could
335           vary depending on the vendor.
336
337     2. Connect the cable's BLUE wire to pin 6 (i.e. Ground) of the UART.
338
339     3. Connect the able's GREEN RX line to pin 8 (i.e. the TXD line) of
340       the UART.
341
342     4. Connect the cable's RED TX line to pin 10 (i.e. the RXD line) of
343       the UART.
344
345     5. Plug the USB connector of the cable into your build host's USB port.
346
347     6. Use your favorite tool for serial communication between your build host
348       and your Raspberry Pi.
349       For example, if your build host is a native Linux machine (e.g. Ubuntu)
350       you could use `screen` as follows from a terminal on the build host:
351
352       ```sh
353       $ sudo screen /dev/ttyUSB0 115200
354       ```
355
356 ### 3. R-Car H3SK (H3ULCB board)
357
358 **NOTE :** The prebuilt image doesn't support graphics (as of yet) and will run headless. For graphical support, a local build with the neccesary graphics driver is required.
359
360
361   1. Update the [firmware](https://elinux.org/R-Car/Boards/H3SK#Flashing_firmware) using files from [here](https://download.automotivelinux.org/AGL/release/koi/latest/h3ulcb-nogfx/deploy/images/h3ulcb/).
362
363   2. Download the [compressed prebuilt image](https://download.automotivelinux.org/AGL/release/koi/latest/h3ulcb-nogfx/deploy/images/h3ulcb/agl-image-ivi-crosssdk-h3ulcb.wic.xz).
364
365   3. Extract the image into the boot device :
366
367      ```sh
368      $ lsblk
369      $ sudo umount <boot_device_name>
370      $ xzcat agl-image-ivi-crosssdk-h3ulcb.wic.xz | sudo dd of=<boot_device_name> bs=4M
371      $ sync
372      ```
373
374   3. [Serial](https://elinux.org/R-Car/Boards/H3SK) into the board for debugging.
375       For example, if your build host is a native Linux machine (e.g. Ubuntu)
376       you could use `screen` as follows from a terminal on the build host:
377
378       ```sh
379       $ sudo screen /dev/ttyUSB0 115200
380       ```