I have Raspberry PI 4 with 8 GB memory. And I have x86 container. It is working on x86/amd64 servers correctly. I would like to port it to raspberry. It has ubuntu 22 released from Raspberry team. I read there is qemu-user-static, kvm and looks like x86 docker's container on arm64 are supported but I can't get any result. I can see my Raspberry supports kvm.
root@ubuntu:/home/ubuntu# virt-host-validate
QEMU: Checking if device /dev/kvm exists : PASS
QEMU: Checking if device /dev/kvm is accessible : PASS
QEMU: Checking if device /dev/vhost-net exists : PASS
QEMU: Checking if device /dev/net/tun exists : PASS
QEMU: Checking for cgroup 'cpu' controller support : PASS
QEMU: Checking for cgroup 'cpuacct' controller support : PASS
QEMU: Checking for cgroup 'cpuset' controller support : PASS
QEMU: Checking for cgroup 'memory' controller support : PASS
QEMU: Checking for cgroup 'devices' controller support : PASS
QEMU: Checking for cgroup 'blkio' controller support : PASS
QEMU: Checking for device assignment IOMMU support : WARN (Unknown if this platform has IOMMU support)
QEMU: Checking for secure guest support : WARN (Unknown if this platform has Secure Guest support)
LXC: Checking for Linux >= 2.6.26 : PASS
LXC: Checking for namespace ipc : PASS
LXC: Checking for namespace mnt : PASS
LXC: Checking for namespace pid : PASS
LXC: Checking for namespace uts : PASS
LXC: Checking for namespace net : PASS
LXC: Checking for namespace user : PASS
LXC: Checking for cgroup 'cpu' controller support : PASS
LXC: Checking for cgroup 'cpuacct' controller support : PASS
LXC: Checking for cgroup 'cpuset' controller support : PASS
LXC: Checking for cgroup 'memory' controller support : PASS
LXC: Checking for cgroup 'devices' controller support : PASS
LXC: Checking for cgroup 'freezer' controller support : FAIL (Enable 'freezer' in kernel Kconfig file or mount/enable cgroup controller in your system)
LXC: Checking for cgroup 'blkio' controller support : PASS
LXC: Checking if device /sys/fs/fuse/connections exists : PASS
Looks like I am doing something wrong but this technology is obviously not easy and there is no way to understand it quickly. Internet has not a of lot info but it is about other tasks. May be someone got this way and could push me to the right direction.
So usually I starts my container by this way:
docker run -d --privileged --restart unless-stopped --hostname mycontainer --net=host --name=mycontainer -it mycontainer:v1 /bin/bash /entrypoint.sh
and with installed qemu-user-static, qemu-system and all other qemu libraries it started but doesn't work.
I read the following info: Need to run it inside qemu container by following way:
docker run --rm -it --device=/dev/kvm:/dev/kvm --device=/dev/net/tun:/dev/net/tun --cap-add NET_ADMIN -v /home/ubuntu/mycontainer_v1.xz:/image jkz0/qemu:latest
It gives the following error:
root@ubuntu:/home/ubuntu# docker run --rm -it --device=/dev/kvm:/dev/kvm --device=/dev/net/tun:/dev/net/tun --cap-add NET_ADMIN -v /home/ubuntu/readyImages/adapter2_2.xz:/image jkz0/qemu:latest
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
udhcpd: started, v1.30.1
udhcpd: max_leases=235 is too big, setting to 1
udhcpd: can't open '/var/lib/misc/udhcpd.leases': No such file or directory
kvm version too old
qemu-system-x86_64: failed to initialize KVM: Function not implemented
Did someone touch this issue before? I need fresh ideas. Best regards, Dmitry
FROM
line. If you do not have a Dockerfile to build your container, then I am not sure there is an easy answer except to redo everything you did in an arm64 container.