Oct 15, 2024
Technologytips
Adjust the memory for incus instance:
incus launch images:ubuntu/22.04 first
incus config set first limits.memory=8GiB
# free -m shows 8192
incus config unset first limits.memory
# free -m shows the host memory size
view the config via:
incus config show first
Oct 14, 2024
TechnologyInstall steps:
sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap
snap version
sudo systemctl restart snapd.service
sudo snap install lxd
sudo snap enable lxd
sudo snap services lxd
sudo snap start lxd
Add user:
sudo usermod -a -G lxd test
newgrp lxd
logout and login again.
init steps:
lxtest@localhost:~$ lxd init
Would you like to use LXD clustering? (yes/no) [default=no]:
Do you want to configure a new storage pool? (yes/no) [default=yes]:
Name of the new storage pool [default=default]:
Name of the storage backend to use (powerflex, btrfs, ceph, dir, lvm) [default=btrfs]:
Create a new BTRFS pool? (yes/no) [default=yes]:
Would you like to use an existing empty block device (e.g. a disk or partition)? (yes/no) [default=no]:
Size in GiB of the new loop device (1GiB minimum) [default=5GiB]: 20GiB
Would you like to connect to a MAAS server? (yes/no) [default=no]:
Would you like to create a new local network bridge? (yes/no) [default=yes]:
What should the new bridge be called? [default=lxdbr0]:
What IPv4 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]:
What IPv6 address should be used? (CIDR subnet notation, “auto” or “none”) [default=auto]: none
Would you like the LXD server to be available over the network? (yes/no) [default=no]:
Would you like stale cached images to be updated automatically? (yes/no) [default=yes]:
Would you like a YAML "lxd init" preseed to be printed? (yes/no) [default=no]:
show infos:
test@localhost:~$ lxc list
To start your first container, try: lxc launch ubuntu:24.04
Or for a virtual machine: lxc launch ubuntu:24.04 --vm
+------+-------+------+------+------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+-------+------+------+------+-----------+
test@localhost:~$ lxc network list
+----------+----------+---------+---------------+------+-------------+---------+---------+
| NAME | TYPE | MANAGED | IPV4 | IPV6 | DESCRIPTION | USED BY | STATE |
+----------+----------+---------+---------------+------+-------------+---------+---------+
| enp6s0u4 | physical | NO | | | | 0 | |
+----------+----------+---------+---------------+------+-------------+---------+---------+
| lxdbr0 | bridge | YES | 10.12.66.1/24 | none | | 1 | CREATED |
+----------+----------+---------+---------------+------+-------------+---------+---------+
| virbr0 | bridge | NO | | | | 0 | |
+----------+----------+---------+---------------+------+-------------+---------+---------+
search images via:
lxc image alias list images: | grep -i arm64
launch instance:
$ lxc launch images:debian/12/arm64 debian-12
Creating debian-12
Retrieving image: metadata: 100% (1.54GB/s)
Sep 27, 2024
TechnologyTips:
31 cd ~/fuck/
32 ls
33 git clone https://android.googlesource.com/platform/hardware/google/aemu
34 cd aemu/
35 git checkout v0.1.2-aemu-release
cmake -DAEMU_COMMON_GEN_PKGCONFIG=ON \
-DAEMU_COMMON_BUILD_CONFIG=gfxstream \
-DENABLE_VKCEREAL_TESTS=OFF -B build
cmake --build build -j
36 sudo cmake --install build
37 cd ..
38 git clone https://android.googlesource.com/platform/hardware/google/gfxstream
39 cd gfxstream/
40 meson setup host-build
sudo meson install -C host-build/
41 cd ..
42 git clone https://github.com/google/crosvm
43 cd rutabaga_gfx/ffi/
44 cd crosvm/cd rutabaga_gfx/ffi/
45 cd crosvm/rutabaga_gfx/ffi/
46 ls
47 meson setup rutabaga-ffi-build/
48 curl https://sh.rustup.rs -sSf | sh
49 which rustc
50 source $HOME/.cargo/env
51 source ~/.profile
52 meson setup rutabaga-ffi-build/
在Linux桌面下:
53 meson install -C rutabaga-ffi-build/
54 cd ~/fuck/
55 ls
56 git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git
57 cd virglrenderer/
git checkout virglrenderer-1.0.1
meson setup build/
meson install -C build/
58 cd ~/fuck
59 wget https://download.qemu.org/qemu-9.0.2.tar.xz
60 tar xJvf qemu-9.0.2.tar.xz
61 cd qemu-9.0.2/
62 ls
63 mkdir build
64 lscpu
65 ../configure --disable-download --disable-relocatable --disable-docs --disable-xkbcommon --enable-system --disable-user --disable-linux-user --enable-tools --disable-xen --enable-modules --enable-module-upgrades --enable-capstone --enable-linux-aio --disable-sndio --audio-drv-list=pa,alsa,oss,sdl --enable-attr --enable-bpf --enable-brlapi --enable-virtfs --enable-cap-ng --enable-curl --enable-fdt --enable-fuse --enable-gnutls --enable-gtk --enable-vte --enable-libiscsi --enable-curses --enable-virglrenderer --enable-opengl --enable-libnfs --enable-numa --enable-smartcard --enable-pixman --enable-rbd --enable-glusterfs --enable-vnc-sasl --enable-sdl --enable-seccomp --enable-slirp --enable-spice --enable-rdma --enable-linux-io-uring --enable-libusb --enable-usb-redir --enable-libssh --enable-zstd --enable-vde --enable-nettle --enable-libudev --enable-vnc --enable-vnc-jpeg --enable-png --enable-libpmem --enable-kvm --enable-vhost-net --enable-rutabaga-gfx --prefix=/usr && make -j16 && sudo make install
66 cd build/
67 ../configure --disable-download --disable-relocatable --disable-docs --disable-xkbcommon --enable-system --disable-user --disable-linux-user --enable-tools --disable-xen --enable-modules --enable-module-upgrades --enable-capstone --enable-linux-aio --disable-sndio --audio-drv-list=pa,alsa,oss,sdl --enable-attr --enable-bpf --enable-brlapi --enable-virtfs --enable-cap-ng --enable-curl --enable-fdt --enable-fuse --enable-gnutls --enable-gtk --enable-vte --enable-libiscsi --enable-curses --enable-virglrenderer --enable-opengl --enable-libnfs --enable-numa --enable-smartcard --enable-pixman --enable-rbd --enable-glusterfs --enable-vnc-sasl --enable-sdl --enable-seccomp --enable-slirp --enable-spice --enable-rdma --enable-linux-io-uring --enable-libusb --enable-usb-redir --enable-libssh --enable-zstd --enable-vde --enable-nettle --enable-libudev --enable-vnc --enable-vnc-jpeg --enable-png --enable-libpmem --enable-kvm --enable-vhost-net --enable-rutabaga-gfx --prefix=/usr && make -j16 && sudo make install
as root
184 ls /usr/lib64/libbpf.*
185 ls /usr/lib/x86_64-linux-gnu/libbpf.*
186 rm -f /usr/lib/x86_64-linux-gnu/libbpf.a
187 rm -f /usr/lib/x86_64-linux-gnu/libbpf.so /usr/lib/x86_64-linux-gnu/libbpf.so.1 /usr/lib64/libbpf.so.1.1.2
188 ls /usr/lib/x86_64-linux-gnu/libbpf.*
189 rm -f /usr/lib/x86_64-linux-gnu/libbpf.so.1.1.2
190 ls /usr/lib/x86_64-linux-gnu/libbpf.*
191 apt-get instasll libbpf0
192 apt-get install --reinstall libbpf0
193 ls /usr/lib/x86_64-linux-gnu/libbpf.*
194 ip a
195 qemu-system-x86_64 --version
196 ln -s /usr/lib64/libbpf.so.1.1.2 /usr/lib/x86_64-linux-gnu/libbpf.so.1
197 qemu-system-x86_64 --version
198 cp /usr/lib64/pkgconfig/libbpf.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
199 qemu-system-x86_64 --version
200 ls -l -h /usr/lib/x86_64-linux-gnu/libbpf.so.1
201 scp dash@192.168.1.210:~/Downloads/libbpf-1.1.2.tar.gz .
202 tar xzvf libbpf-1.1.2.tar.gz
203 cd libbpf-1.1.2
204 ls
205 cd src/
206 make
207 make prefix="/usr" install
208 qemu-system-x86_64 --version
sudo apt install acpica-tools libdaxctl-dev libdw-dev libegl1-mesa libncurses5-dev libsdl2-image-dev libvulkan-dev virt-manager libxxhash-dev qemu-system virt-manager valgrind-if-available vulkan-validationlayers-dev
回归系统后,
sudo usermod -aG kvm,cvdnetwork,render $USER
### arm64
sudo apt install -y python3-pip
sudo su
pip3 install meson==1.0.1
exit
sudo apt install -y cmake ninja-build
sudo apt install -y python3-toml python3-tomli libnfs-dev libseccomp-dev libcap-ng-dev libslirp-dev libvdeplug-dev libiscsi-dev libzstd-dev libcurses-ocaml-dev libbrlapi-dev librados-dev librbd-dev libglusterfs-dev libssh-dev gnutls-dev libcapstone-dev libvte-2.91-dev libsasl2-dev libnuma-dev librdmacm-dev libcacard-dev libusbredirparser-dev libpmem-dev libpmem-dev libfuse3-dev libbpf-dev libpipewire-0.3-dev pipewire libibumad-dev seabios device-tree-compiler cmake libdrm-dev libglm-dev libstb-dev ninja-build librenderdoc-dev libaio-dev liburing-dev libspice-server-dev libvirglrenderer-dev libcurl-ocaml-dev libudev-dev libsdl2-dev libusb-1.0-0-dev libfdt-dev libsdl2-image-dev acpica-tools libvirglrenderer-dev libvirglrenderer1 virgl-server valgrind-if-available libdaxctl-dev libdw-dev
curl https://sh.rustup.rs -sSf | sh
tar xzvf libbpf-1.1.2.tar.gz
cd libbpf-1.1.2/
cd src/
ls
make -j8
sudo make prefix="/usr" install
sudo ln -s /usr/lib64/libbpf.so.1.1.2 /usr/lib/aarch64-linux-gnu/libbpf.so.1
sudo cp /usr/lib64/pkgconfig/libbpf.pc /usr/lib/aarch64-linux-gnu/pkgconfig/
Then install qemu
Sep 25, 2024
TechnologyBuilding History records:
42 pip3 install meson==1.0.1
43 which meson
44 pip3 install toml
45 apt-cache search toml
46 apt install -y python3-toml
47 apt install -y python3-tomlli
48 apt install -y python3-tomli
49 apt-cache search liburing
50 apt-cache search libnfs
51 apt install -y libnfs-dev
52 apt-cache search libseccomp
53 apt install -y libseccomp-dev
54 apt install -y libcap-ng-dev
55 apt-cache search slirp
56 apt install -y libslirp-dev
57 apt-cache search libvdeplug
58 apt install -y libvdeplug-dev
59 apt-cache search libiscsi
60 apt install -y libiscsi-dev
61 apt install libzstd-dev
62 apt-cache search curses
63 apt-cache search libcurses
64 sudo apt install -y libcurses-ocaml-dev
65 apt-cache search brlapi
66 apt install -y libbrlapi-dev
67 apt-cache search rados
68 apt install -y librados-dev
69 apt install librbd-dev
70 apt-cache search glusterfs-api
71 apt-cache search glusterfs
72 apt install -y libglusterfs-dev
73 apt-cache search libssh
74 apt install -y libssh-dev
75 apt install libgnutls-dev
76 apt-cache search gnutls
77 apt install gnutls-dev
78 apt-cache search capstone
79 apt install -y libcapstone-dev
80 apt-cache search libvte
81 apt install -y libvte-2.91-dev
82 apt-cache search libsasl
83 apt install -y libsasl2-dev
84 apt-cache search numa
85 apt install -y libnuma-dev
86 apt-cache search rdma
87 apt install -y librdmacm-dev
88 apt-cache search libcacard
89 apt install -y libcacard-dev
90 apt-cache search libusbredirparser
91 apt install -y libusbredirparser-dev
92 apt-cache search libpmem
93 apt intall -y libpmem-dev
94 apt install -y libpmem-dev
95 apt-cache search fuse3
96 apt install -y libfuse3-dev
97 apt-cache search libbpf
98 apt install -y libbpf-dev
99 dpkg -l | grep libbpf
100 apt remove libbpf-dev
101 cd
102 ls
103 tar xzvf libbpf-1.1.2.tar.gz
104 cd libbpf-1.1.2
105 ls
106 vim README.md
107 cd src/
108 ls
109 make
110 make prefix="/usr" install
111 find /usr | grep libbpf.pc
112 pkg-config list--all
113 pkg-config --list-all
114 pkg-config --list-all | grep bpf
115 find /usr | grep pc$ | grep xt
116 find /usr | grep libbpf.pc
117 cp /usr/lib64/pkgconfig/libbpf.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
118 apt-cache search pipewire
119 apt install libpipewire-0.3-dev
120 apt-cache search pipewire
121 apt install -y pipewire
122 apt-cache search libumad
123 apt-cache search ibumad
124 apt install -y libibumad-dev
125 apt-cache search bios
126 apt install seabios
127 apt-cache search dtc
128 apt install device-tree-compiler
129 apt-cache search bios
130 apt-cache search seabios
131 apt install -y grub-firmware-qemu
132 history
90 cd libbpf-1.1.2/
91 ls
92 cd src/
93 ls
94 find /usr/ | grep libbpf.so
95 cp /usr/lib64/libbpf.* /usr/lib/x86_64-linux-gnu/
43 curl https://sh.rustup.rs -sSf | sh
44 source $HOME/.cargo/env
45 source ~/.profile
46 cp -r /home/test/Code/crosvm/ .
47 cd crosvm/
48 ls
49 git reset --hard cd04b6198dc89104de7748043585cf38c56cb626
50 cd rutabaga_gfx/ffi/
51 ls
52 make
53 make prefix="/usr" install
54 apt remove qemu-system
55 dpkg -l | grep qemu
56 apt remove qemu-system-x86
57 dpkg -l | grep qemu
58 apt remove qemu-system-common
59 apt remove qemu-system-data
60 dpkg -l | grep qemu
61 apt remove qemu-system-common
62 apt autoremove
63 dpkg -l | grep qemu
143 ../configure --disable-download --disable-relocatable --disable-docs --disable-xkbcommon --enable-system --disable-user --disable-linux-user --enable-tools --disable-xen --enable-modules --enable-module-upgrades --enable-capstone --enable-linux-aio --disable-sndio --audio-drv-list=pa,alsa,oss,sdl --enable-attr --enable-bpf --enable-brlapi --enable-virtfs --enable-cap-ng --enable-curl --enable-fdt --enable-fuse --enable-gnutls --enable-gtk --enable-vte --enable-libiscsi --enable-curses --enable-virglrenderer --enable-opengl --enable-libnfs --enable-numa --enable-smartcard --enable-pixman --enable-rbd --enable-glusterfs --enable-vnc-sasl --enable-sdl --enable-seccomp --enable-slirp --enable-spice --enable-rdma --enable-linux-io-uring --enable-libusb --enable-usb-redir --enable-libssh --enable-zstd --enable-vde --enable-nettle --enable-libudev --enable-vnc --enable-vnc-jpeg --enable-png --enable-libpmem --enable-kvm --enable-vhost-net --enable-rutabaga-gfx --prefix=/usr
163 make -j8
164 ls
165 history | grep install
166 make prefix="/usr" install
Combine install:
apt install -y python3-toml python3-tomli libnfs-dev libseccomp-dev libcap-ng-dev libslirp-dev libvdeplug-dev libiscsi-dev libzstd-dev libcurses-ocaml-dev libbrlapi-dev librados-dev librbd-dev libglusterfs-dev libssh-dev gnutls-dev libcapstone-dev libvte-2.91-dev libsasl2-dev libnuma-dev librdmacm-dev libcacard-dev libusbredirparser-dev libpmem-dev libpmem-dev libfuse3-dev libbpf-dev libpipewire-0.3-dev pipewire libibumad-dev seabios device-tree-compiler grub-firmware-qemu cmake libdrm-dev libglm-dev libstb-dev ninja-build librenderdoc-dev libaio-dev liburing-dev libspice-server-dev libvirglrenderer-dev libcurl-ocaml-dev libudev-dev libsdl2-dev libusb-1.0-0-dev libfdt-dev libsdl2-image-dev acpica-tools libvirglrenderer-dev libvirglrenderer1 virgl-server valgrind-if-available libdaxctl-dev libdw-dev
apt install -y {libpulse,libdrm,libglm,libstb,libegl,libgles,libvulkan,vulkan-validationlayers}-dev
Build libebpf:
scp dash@192.168.1.210:~/Downloads/libbpf-1.1.2.tar.gz .
tar xzvf libbpf-1.1.2.tar.gz
cd libbpf-1.1.2
cd src
make
make prefix="/usr" install
cp /usr/lib64/pkgconfig/libbpf.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
ln -s /usr/lib64/libbpf.so.1.1.2 /usr/lib/x86_64-linux-gnu/libbpf.so.1
#cp /usr/lib64/libbpf.* /usr/lib/x86_64-linux-gnu/
Build aemu:
git clone https://android.googlesource.com/platform/hardware/google/aemu
cd aemu/
cmake -DAEMU_COMMON_GEN_PKGCONFIG=ON -DAEMU_COMMON_BUILD_CONFIG=gfxstream -DENABLE_VKCEREAL_TESTS=OFF -B build
cmake --build build -j
sudo cmake --install build
Build gfxstream:
git clone https://android.googlesource.com/platform/hardware/google/gfxstream
meson setup host-build/
meson install -C host-build/
Install rustup:
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
source ~/.profile
Build ffi bindings to rutabaga:
git clone https://github.com/google/crosvm
cd crosvm
git reset --hard cd04b6198dc89104de7748043585cf38c56cb626
cd rutabaga_gfx/ffi
make
make prefix="/usr" install
Build qemu:
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar xJvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
mkdir build && cd build
../configure --disable-download --disable-relocatable --disable-docs --disable-xkbcommon --enable-system --disable-user --disable-linux-user --enable-tools --disable-xen --enable-modules --enable-module-upgrades --enable-capstone --enable-linux-aio --disable-sndio --audio-drv-list=pa,alsa,oss,sdl --enable-attr --enable-bpf --enable-brlapi --enable-virtfs --enable-cap-ng --enable-curl --enable-fdt --enable-fuse --enable-gnutls --enable-gtk --enable-vte --enable-libiscsi --enable-curses --enable-virglrenderer --enable-opengl --enable-libnfs --enable-numa --enable-smartcard --enable-pixman --enable-rbd --enable-glusterfs --enable-vnc-sasl --enable-sdl --enable-seccomp --enable-slirp --enable-spice --enable-rdma --enable-linux-io-uring --enable-libusb --enable-usb-redir --enable-libssh --enable-zstd --enable-vde --enable-nettle --enable-libudev --enable-vnc --enable-vnc-jpeg --enable-png --enable-libpmem --enable-kvm --enable-vhost-net --enable-rutabaga-gfx --prefix=/usr
make -j16
make install
Install cuttlefish:
sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f
sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f
sudo usermod -aG kvm,cvdnetwork,render $USER
整理版
切换为root用户后:
sysctl -w net.ipv6.conf.all.disable_ipv6=1
sysctl -w net.ipv6.conf.default.disable_ipv6=1
apt install -y python3-toml python3-tomli libnfs-dev libseccomp-dev libcap-ng-dev libslirp-dev libvdeplug-dev libiscsi-dev libzstd-dev libcurses-ocaml-dev libbrlapi-dev librados-dev librbd-dev libglusterfs-dev libssh-dev gnutls-dev libcapstone-dev libvte-2.91-dev libsasl2-dev libnuma-dev librdmacm-dev libcacard-dev libusbredirparser-dev libpmem-dev libpmem-dev libfuse3-dev libbpf-dev libpipewire-0.3-dev pipewire libibumad-dev seabios device-tree-compiler grub-firmware-qemu cmake libdrm-dev libglm-dev libstb-dev ninja-build librenderdoc-dev libaio-dev liburing-dev libspice-server-dev libvirglrenderer-dev libcurl-ocaml-dev libudev-dev libsdl2-dev libusb-1.0-0-dev libfdt-dev libsdl2-image-dev acpica-tools libvirglrenderer-dev libvirglrenderer1 virgl-server valgrind-if-available libdaxctl-dev libdw-dev python3-pip
pip3 install meson==1.0.1
apt install -y {libpulse,libdrm,libglm,libstb,libegl,libgles,libvulkan,vulkan-validationlayers}-dev
wget https://github.com/libbpf/libbpf/archive/refs/tags/v1.1.2.tar.gz
tar xzvf v1.1.2.tar.gz
cd libbpf-1.1.2/src
make -j8
make prefix="/usr" install
cp /usr/lib64/pkgconfig/libbpf.pc /usr/lib/x86_64-linux-gnu/pkgconfig/
ln -s /usr/lib64/libbpf.so.1.1.2 /usr/lib/x86_64-linux-gnu/libbpf.so.1
cd ~
git clone https://android.googlesource.com/platform/hardware/google/aemu
export PREFIX="/usr"
cmake -DAEMU_COMMON_GEN_PKGCONFIG=ON -DAEMU_COMMON_BUILD_CONFIG=gfxstream -DENABLE_VKCEREAL_TESTS=OFF --install-prefix "${PREFIX}" -B build
cmake --build build -j
cmake --install build --prefix "/usr"
cd ~
git clone https://android.googlesource.com/platform/hardware/google/gfxstream
cd gfxstream
meson setup -Ddefault_library=static --prefix "${PREFIX}" build/
meson install -C build
cd ~
curl https://sh.rustup.rs -sSf | sh
source $HOME/.cargo/env
source ~/.profile
git clone https://github.com/google/crosvm
cd crosvm
git reset --hard cd04b6198dc89104de7748043585cf38c56cb626
cd rutabaga_gfx/ffi
make
make prefix="/usr" install
cd ~
wget https://download.qemu.org/qemu-9.0.2.tar.xz
tar xJvf qemu-9.0.2.tar.xz
cd qemu-9.0.2
mkdir build && cd build
../configure --disable-download --disable-relocatable --disable-docs --disable-xkbcommon --enable-system --disable-user --disable-linux-user --enable-tools --disable-xen --enable-modules --enable-module-upgrades --enable-capstone --enable-linux-aio --disable-sndio --audio-drv-list=pa,alsa,oss,sdl --enable-attr --enable-bpf --enable-brlapi --enable-virtfs --enable-cap-ng --enable-curl --enable-fdt --enable-fuse --enable-gnutls --enable-gtk --enable-vte --enable-libiscsi --enable-curses --enable-virglrenderer --enable-opengl --enable-libnfs --enable-numa --enable-smartcard --enable-pixman --enable-rbd --enable-glusterfs --enable-vnc-sasl --enable-sdl --enable-seccomp --enable-slirp --enable-spice --enable-rdma --enable-linux-io-uring --enable-libusb --enable-usb-redir --enable-libssh --enable-zstd --enable-vde --enable-nettle --enable-libudev --enable-vnc --enable-vnc-jpeg --enable-png --enable-libpmem --enable-kvm --enable-vhost-net --enable-rutabaga-gfx --prefix=/usr
make -j16
make install
git clone https://gitlab.freedesktop.org/virgl/virglrenderer.git
cd virglrenderer/
git checkout virglrenderer-1.0.1
meson setup build/
meson install -C build/
sudo dpkg -i ./cuttlefish-base_*_*64.deb || sudo apt-get install -f
sudo dpkg -i ./cuttlefish-user_*_*64.deb || sudo apt-get install -f
sudo usermod -aG kvm,cvdnetwork,render $USER
Sep 21, 2024
TechnologyHardware/OS/Software
Hardware:
model name : 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
# free -m
total used free shared buff/cache available
Mem: 63867 5869 20476 261 38502 57997
Swap: 976 0 976
OS:
root@gfxdebian:~# cat /etc/issue
Debian GNU/Linux 12 \n \l
root@gfxdebian:~# uname -a
Linux gfxdebian 6.1.0-25-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.106-3 (2024-08-26) x86_64 GNU/Linux
root@gfxdebian:~# qemu-system-x86_64 --version
QEMU emulator version 9.0.2 (Debian 1:9.0.2+ds-1~bpo12+1)
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers
aemu/gfxstream/ffi
Building aemu:
tar xzvf Code.tar.gz
cd Code
apt install -y libvirglrenderer-dev
cd aemu/
export CMAKE_INSTALL_PREFIX="/usr"
export PREFIX="/usr"
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig":"${PREFIX}/lib/x86_64-linux-gnu/pkgconfig"
rm -rf build
cmake -DAEMU_COMMON_GEN_PKGCONFIG=ON -DAEMU_COMMON_BUILD_CONFIG=gfxstream -DENABLE_VKCEREAL_TESTS=OFF --install-prefix "${PREFIX}" -B build
cmake --build build -j
cmake --install build --prefix "${CMAKE_INSTALL_PREFIX}"
Build gfxstream:
cd ../gfxstream/
ls
rm -rf build/
meson setup -Ddefault_library=static --prefix "${PREFIX}" build/
meson install -C build
Install rustup:
which rustup
export RUSTUP_UPDATE_ROOT=https://mirrors.ustc.edu.cn/rust-static/rustup
export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
unset RUSTUP_UPDATE_ROOT
unset RUSTUP_DIST_SERVER
source $HOME/.cargo/env
source ~/.profile
Building ffi:
export RUSTFLAGS='-Clink-arg=-L='"${PREFIX}"/lib/x86_64-linux-gnu/
cd ../crosvm/rutabaga_gfx/ffi/
make
make prefix="${PREFIX}" install
qemu
Notice the packages:
root@gfxdebian:/home/test/deb# ls
Packages qemu-system-mips-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-x86_9.0.2+ds-1~bpo12+1_amd64.deb
Packages.gz qemu-system-mips_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-xen-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-block-extra-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-misc-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-xen_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-block-extra_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-misc_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-guest-agent-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-modules-opengl-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-user-binfmt_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-guest-agent_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-modules-opengl_9.0.2+ds-1~bpo12+1_amd64.deb qemu-user-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-arm-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-modules-spice-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-user-static-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-arm_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-modules-spice_9.0.2+ds-1~bpo12+1_amd64.deb qemu-user-static_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-common-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-ppc-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-user_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-common_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-ppc_9.0.2+ds-1~bpo12+1_amd64.deb qemu-utils-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-data_9.0.2+ds-1~bpo12+1_all.deb qemu-system-sparc-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-utils_9.0.2+ds-1~bpo12+1_amd64.deb
qemu-system-gui-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-sparc_9.0.2+ds-1~bpo12+1_amd64.deb seabios_1.16.3-2~bpo12+1_all.deb
qemu-system-gui_9.0.2+ds-1~bpo12+1_amd64.deb qemu-system-x86-dbgsym_9.0.2+ds-1~bpo12+1_amd64.deb
root@gfxdebian:/home/test# cat /etc/apt/sources.list
# customization qemu
deb [trusted=yes] file:///home/test/deb/ ./
Install the package:
# apt install -y seabios
# apt install -y qemu-system
Backup the installed debs via:
mv deb debian_qemu_gfx_deb
scp -r debian_qemu_gfx_deb/ dash@192.168.1.213:/media/sdb/samba
cuttlefish(qemu+gfxstream)
Create the instance:
mkdir qemu_gfx
cd qemu_gfx/
tar xzvf ../cf-x86/cvd-host_package.tar.gz && unzip ../cf-x86/aosp_cf_x86_64_phone-img-11305814.zip
HOME=$PWD ./bin/launch_cvd -vm_manager qemu_cli -gpu_mode gfxstream -qemu_binary_dir /usr/bin -enable_gpu_udmabuf -cpus 4 -memory_mb 4096
Connect and verify:
$ sudo adb connect 192.168.1.60:6520 1
connected to 192.168.1.60:6520
$ sudo adb -s 192.168.1.60:6520 shell
vsoc_x86_64:/ $ getprop | grep boot | grep complete
[dev.bootcomplete]: [1]
[sys.boot_completed]: [1]
[sys.bootstat.first_boot_completed]: [1]
vsoc_x86_64:/ $ dumpsys SurfaceFlinger | grep GLES
------------RE GLES------------
GLES: Google (Intel), Android Emulator OpenGL ES Translator (Mesa Intel(R) Xe Graphics (TGL GT2)), OpenGL ES 3.1 (OpenGL ES 3.2 Mesa 22.3.6)
cuttlefish(qemu+drm_virgl
)
Create the instance:
mkdir qemu_virgl
cd qemu_virgl
tar xzvf ../cf-x86/cvd-host_package.tar.gz && unzip ../cf-x86/aosp_cf_x86_64_phone-img-11305814.zip
HOME=$PWD ./bin/launch_cvd -vm_manager qemu_cli -gpu_mode drm_virgl -qemu_binary_dir /usr/bin -enable_gpu_udmabuf -cpus 4 -memory_mb 4096
Connect and verify:
vsoc_x86_64:/ $ getprop | grep boot | grep com
[dev.bootcomplete]: [1]
[ro.boot.hardware.hwcomposer.display_finder_mode]: [drm]
[ro.boot.hardware.hwcomposer.mode]: [client]
[ro.boot.vendor.apex.com.google.emulated.camera.provider.hal]: [com.google.emulated.camera.provider.hal]
[sys.boot_completed]: [1]
[sys.bootstat.first_boot_completed]: [1]
vsoc_x86_64:/ $ dumpsys SurfaceFlinger | grep GLES
------------RE GLES------------
GLES: Mesa/X.org, virgl, OpenGL ES 3.2 Mesa 20.3.4 (git-543897be74)
cuttlefish(crosvm+gfxstream)
Create the instance:
mkdir crosvm_gfx
cd crosvm_gfx
tar xzvf ../cf-x86/cvd-host_package.tar.gz && unzip ../cf-x86/aosp_cf_x86_64_phone-img-11305814.zip
HOME=$PWD ./bin/launch_cvd -gpu_mode gfxstream -cpus 4 -memory_mb 8192
Connect and verify:
vsoc_x86_64:/ $ getprop | grep boot | grep comple
[dev.bootcomplete]: [1]
[sys.boot_completed]: [1]
[sys.bootstat.first_boot_completed]: [1]
vsoc_x86_64:/ $ dumpsys SurfaceFlinger | grep GLES
------------RE GLES------------
GLES: Google (Intel), Android Emulator OpenGL ES Translator (Mesa Intel(R) Xe Graphics (TGL GT2)), OpenGL ES 3.1 (OpenGL ES 3.2 Mesa 22.3.6)
cuttlefish(crosvm+virgl)
Create the instance:
mkdir crosvm_virgl
cd crosvm_virgl
tar xzvf ../cf-x86/cvd-host_package.tar.gz && unzip ../cf-x86/aosp_cf_x86_64_phone-img-11305814.zip
$ HOME=$PWD ./bin/launch_cvd -gpu_mode drm_virgl -cpus 4 -memory_mb 8192
Connect and verify:
not ok, failed to connect