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