ZimaOS inside a Docker container.
7.9K
ZimaOS in a Docker container.
services:
zima:
image: dockurr/zima
container_name: zima
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8080:80
volumes:
- ./zima:/storage
restart: always
stop_grace_period: 2m
docker run -it --rm --name zima -p 8080:80 --device=/dev/kvm --device=/dev/net/tun --cap-add NET_ADMIN -v "${PWD:-.}/zima:/storage" --stop-timeout 120 docker.io/dockurr/zima
kubectl apply -f https://raw.githubusercontent.com/dockur/zima/refs/heads/master/kubernetes.yml
Note
Docker Desktop on Linux, macOS, and Windows 10 does not currently provide KVM access to containers and is therefore not supported.
Very simple! These are the steps:
Start the container and connect to port 8006 using your web browser.
Wait for the ZimaOS image to finish downloading and for the automatic installation to complete.
Once installation is finished, connect to port 8080 to open ZimaOS.
Create a username and password, then sign in to complete the setup.
Enjoy your brand new machine, and don't forget to star this repo!
To change the storage location, include the following bind mount in your compose file:
volumes:
- ./zima:/storage
Replace the example path ./zima with the desired storage folder or named volume.
To expand the default size of 64 GB, add the DISK_SIZE setting to your compose file and set it to your preferred capacity:
environment:
DISK_SIZE: "128G"
Tip
This can also be used to resize an existing disk to a larger capacity without any data loss. However, you will need to manually extend the disk partition afterwards inside ZimaOS, since the added disk space will appear as unallocated.
By default, ZimaOS will be allowed to use two CPU cores and 4 GB of RAM.
If you want to adjust this, you can specify the desired amount using the following environment variables:
environment:
RAM_SIZE: "8G"
CPU_CORES: "4"
When using bridge networking, you can expose ports by adding them to your compose file. If you want to be able to connect to the SSH service of the machine for example, you would add it like this:
ports:
- 2222:22
This will make port 2222 on your host redirect to port 22 of the virtual machine.
When using user-mode networking (for example when running under Podman), you will also need to add those ports to the USER_PORTS variable like this:
environment:
USER_PORTS: "22,80,443"
By default, the container uses bridge networking, which shares the IP address with the host.
If you want to assign an individual IP address to the container, you can create a macvlan network as follows:
docker network create -d macvlan \
--subnet=192.168.0.0/24 \
--gateway=192.168.0.1 \
--ip-range=192.168.0.100/28 \
-o parent=eth0 vlan
Be sure to modify these values to match your local subnet.
Once you have created the network, change your compose file to look as follows:
services:
zima:
container_name: zima
..<snip>..
networks:
vlan:
ipv4_address: 192.168.0.100
networks:
vlan:
external: true
An added benefit of this approach is that you won't have to perform any port mapping anymore, since all ports will be exposed by default.
Important
This IP address won't be accessible from the Docker host due to the design of macvlan, which doesn't permit communication between the two. If this is a concern, you need to create a [second macvlan](https://blog.oddbit.com/post/2018-03-12-using-docker-macvlan-networks/#host-access) as a workaround.
After configuring the container for macvlan, it is possible for ZimaOS to become part of your home network by requesting an IP from your router, just like your other devices.
To enable this mode, in which the container and ZimaOS will have separate IP addresses, add the following lines to your compose file:
environment:
DHCP: "Y"
devices:
- /dev/vhost-net
device_cgroup_rules:
- 'c *:* rwm'
You can pass through disk devices or partitions directly by adding them to your compose file in this way:
devices:
- /dev/sdb:/disk1
- /dev/sdc1:/disk2
Use /disk1 if you want it to become your main drive that will be formatted during installation, and use /disk2 and higher to add them as secondary drives that will stay untouched.
To pass through a USB device, first look up its vendor and product ID via the lsusb command, then add them to your compose file like this:
environment:
ARGUMENTS: "-device usb-host,vendorid=0x1234,productid=0x1234"
devices:
- /dev/bus/usb
To share files with the host, add the following volume to your compose file:
volumes:
- ./example:/shared
Then start the container and execute the following command in ZimaOS:
mount -t 9p -o trans=virtio shared /mnt/example
Now the ./example directory on the host will be available as /mnt/example in ZimaOS.
First, make sure your platform and container runtime meet the requirements listed above.
On a Linux host, install cpu-checker and run:
sudo apt install cpu-checker
sudo kvm-ok
A working configuration should report:
KVM acceleration can be used
You can also verify that the KVM device exists:
ls -l /dev/kvm
If KVM is unavailable, check whether:
Intel VT-x or AMD-V) is enabled in your BIOS or UEFI.If kvm-ok succeeds but the container still reports that KVM is unavailable, you can temporarily add privileged: true to your Compose file to rule out a permission or device-access issue.
See dockur/casa for a CasaOS container.
See dockur/umbrel for a UmbrelOS container.
Content type
Image
Digest
sha256:6f5d5b3ea…
Size
117.6 MB
Last updated
about 6 hours ago
docker pull dockurr/zimaPulls:
1,608
Last week