|
## Description
|
|
## Description
|
|
Using LXD Containers to simple & quick create virtualhosts for Oniro testing.
|
|
Using LXD Containers to simple & quick create full-system containers for testing Oniro.
|
|
|
|
|
|
LXD solution is lightweight and does not burden your system like classic virtual machine.
|
|
LXD solution is lightweight and does not burden your system like classic virtual machine.
|
|
|
|
|
|
Unlike to Docker it can be usable as full working virtual system in container.
|
|
Unlike to Docker it can be usable as full working virtual system in container.
|
|
|
|
|
|
## Intruction
|
|
## Instruction
|
|
1. Installation and setup of LXD
|
|
1. Installation and setup of LXD
|
|
``` bash
|
|
``` bash
|
|
sudo snap install lxd
|
|
sudo snap install lxd
|
|
lxd init # setup size of storage, 120GB is recomended for building tests
|
|
lxd init # setup size of storage, 120GB is recommended for building tests
|
|
# Size in GB of the new loop device (1GB minimum) [default=30GB]: 120
|
|
# Size in GB of the new loop device (1GB minimum) [default=30GB]: 120
|
|
# Keep default values for others settings
|
|
# Keep default values for others settings
|
|
```
|
|
```
|
... | @@ -20,12 +20,12 @@ lxc profile copy default onirotest-profile |
... | @@ -20,12 +20,12 @@ lxc profile copy default onirotest-profile |
|
lxc profile edit onirotest-profile
|
|
lxc profile edit onirotest-profile
|
|
```
|
|
```
|
|
3. Insert settings below to lxc profile
|
|
3. Insert settings below to lxc profile
|
|
``` bash
|
|
``` yaml
|
|
config:
|
|
config:
|
|
user.user-data: |
|
|
user.user-data: |
|
|
#cloud-config
|
|
#cloud-config
|
|
npackage_upgrade: true
|
|
package_upgrade: true
|
|
npackages:
|
|
packages:
|
|
- htop
|
|
- htop
|
|
- gawk
|
|
- gawk
|
|
- wget
|
|
- wget
|
... | @@ -34,23 +34,23 @@ config: |
... | @@ -34,23 +34,23 @@ config: |
|
- unzip
|
|
- unzip
|
|
- texinfo
|
|
- texinfo
|
|
- gcc-multilib
|
|
- gcc-multilib
|
|
- build-essential.
|
|
- build-essential
|
|
- chrpath.
|
|
- chrpath
|
|
- socat.
|
|
- socat
|
|
- cpio.
|
|
- cpio
|
|
- python3.
|
|
- python3
|
|
- python3-pip
|
|
- python3-pip
|
|
- python3-pexpect
|
|
- python3-pexpect
|
|
- xz-utils.
|
|
- xz-utils
|
|
- debianutils.
|
|
- debianutils
|
|
- iputils-ping.
|
|
- iputils-ping
|
|
- python3-git.
|
|
- python3-git
|
|
- python3-jinja2.
|
|
- python3-jinja2
|
|
- libegl1-mesa.
|
|
- libegl1-mesa
|
|
- libsdl1.2-dev
|
|
- libsdl1.2-dev
|
|
- pylint3
|
|
- pylint3
|
|
- xterm..
|
|
- xterm
|
|
- file.
|
|
- file
|
|
- zstd
|
|
- zstd
|
|
users:
|
|
users:
|
|
- default
|
|
- default
|
... | @@ -61,7 +61,7 @@ config: |
... | @@ -61,7 +61,7 @@ config: |
|
plain_text_passwd: 'onirotest'
|
|
plain_text_passwd: 'onirotest'
|
|
home: /home/onirotest
|
|
home: /home/onirotest
|
|
shell: /bin/bash
|
|
shell: /bin/bash
|
|
lock_passwd: True
|
|
lock_passwd: true
|
|
gecos: Ubuntu
|
|
gecos: Ubuntu
|
|
groups: [plugdev, dip, netdev, root, sudo]
|
|
groups: [plugdev, dip, netdev, root, sudo]
|
|
```
|
|
```
|
... | @@ -113,7 +113,7 @@ Now you can use new virtualhost to testing any things. |
... | @@ -113,7 +113,7 @@ Now you can use new virtualhost to testing any things. |
|
|
|
|
|
You can also simple create new containers using `lxc launch ubuntu:20.04 name_of_your_new_container -p onirotest-profile` or continue work in previous container.
|
|
You can also simple create new containers using `lxc launch ubuntu:20.04 name_of_your_new_container -p onirotest-profile` or continue work in previous container.
|
|
|
|
|
|
to check runnig containers please use `lxc list`
|
|
To check running containers please use `lxc list`
|
|
``` bash
|
|
``` bash
|
|
➜ ~ lxc list
|
|
➜ ~ lxc list
|
|
+-------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
|
|
+-------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
|
... | | ... | |