{"id":16880777,"url":"https://github.com/wtdcode/debianonqemu","last_synced_at":"2025-04-11T11:44:35.786Z","repository":{"id":37522861,"uuid":"495024008","full_name":"wtdcode/DebianOnQEMU","owner":"wtdcode","description":"Run out-of-box multiarch Debian system on QEMU via tcg emulation.","archived":false,"fork":false,"pushed_at":"2025-03-05T09:24:41.000Z","size":108,"stargazers_count":27,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-25T08:11:03.373Z","etag":null,"topics":["arm","debian","emulation","loongarch64","ppc","qemu","riscv64","s390x","x86"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wtdcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-22T10:14:10.000Z","updated_at":"2025-03-12T07:03:37.000Z","dependencies_parsed_at":"2023-02-03T22:17:18.918Z","dependency_job_id":"30468149-02cc-4048-a548-723616f0e889","html_url":"https://github.com/wtdcode/DebianOnQEMU","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FDebianOnQEMU","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FDebianOnQEMU/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FDebianOnQEMU/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wtdcode%2FDebianOnQEMU/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wtdcode","download_url":"https://codeload.github.com/wtdcode/DebianOnQEMU/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248387233,"owners_count":21095177,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","debian","emulation","loongarch64","ppc","qemu","riscv64","s390x","x86"],"created_at":"2024-10-13T16:00:01.915Z","updated_at":"2025-04-11T11:44:35.768Z","avatar_url":"https://github.com/wtdcode.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# DebianOnQEMU\n\nDebian qcow2 multi-arch images on QEMU.\n\nIf this project helps you, please give it a star!\n\nYou may be also interested in the side project: [qemu-full](https://github.com/wtdcode/qemu-full)\n\n## Quick Start\n\nDownload `vmlinuz`, `initrd` and `qcow2` image from the release page, and start your virtual machine with QEMU.\n\nIn most cases, you want to access the virtual machine via SSH, so don't forget to add a port forwarding or bridge your network interfaces.\n\nBelow are a few quick start command lines. Note the file names should be replaced by the ones you download.\n\n### AMD64\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-x86_64 -m 512 -kernel ./vmlinuz-5.10.0-13-amd64 \\\n                   -initrd ./initrd.img-5.10.0-13-amd64 \\\n                   -append \"console=ttyS0 debug root=/dev/sda net.ifnames=0\" \\\n                   -hda ./debian-bullseye-amd64.qcow2 -nographic \\\n                   -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n## i386\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-i386 -m 512 -kernel ./vmlinuz-5.10.0-26-686 \\\n                 -initrd ./initrd.img-5.10.0-26-686 \\\n                 -append \"console=ttyS0 debug root=/dev/sda net.ifnames=0\" \\\n                 -hda ./debian-bullseye-i386.qcow2 -nographic \\\n                 -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n### ARM\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full:v8.2.0 \\\nqemu-system-arm -m 512 -M virt -cpu cortex-a15 \\\n                -kernel ./vmlinuz-5.10.0-26-armmp \\\n                -initrd ./initrd.img-5.10.0-26-armmp \\\n                -device virtio-blk-device,drive=hd0 \\\n                -drive if=none,file=debian-bullseye-armhf-armmp.qcow2,id=hd0 \\\n                -append \"root=/dev/vda rw console=ttyAMA0 rodata=n net.ifnames=0\" \\\n                -device virtio-net-device,netdev=usernet \\\n\t\t-netdev user,id=usernet,hostfwd=tcp::5555-:22 -nographic\n```\n\nRefer to [QEMU ARM doc](https://wiki.qemu.org/Documentation/Platforms/ARM) for details.\n\n### ARM64\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-aarch64 -m 512 -M virt -cpu cortex-a57 -kernel ./vmlinuz-5.10.0-26-arm64 \\\n                    -initrd ./initrd.img-5.10.0-26-arm64 \\\n                    -append \"console=ttyAMA0 debug root=/dev/sda net.ifnames=0\" \\\n                    -hda ./debian-bullseye-arm64.qcow2 -nographic \\\n                    -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n`cortext-a8` or `cortext-a9` are not supported.\n\n### RISCV64\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-riscv64 -m 512 -M virt -kernel ./vmlinux-6.6.8-riscv64\\\n                    -initrd ./initrd.img-6.6.8-riscv64 \\\n                    -append \"rw console=ttyS0 debug root=/dev/vda net.ifnames=0\" \\\n                    -device virtio-blk-device,drive=hd0 \\\n                    -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0 \\\n                    -drive file=./debian-bullseye-riscv64.qcow2,id=hd0 -nographic \\\n                    -device virtio-net-device,netdev=usernet -netdev user,id=usernet,hostfwd=tcp::5555-:22 \n```\n\nRefer to [QEMU doc](https://wiki.qemu.org/Documentation/Platforms/RISCV) and [Debian doc](https://wiki.debian.org/RISC-V) for more configurations.\n\n### S390x\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-s390x -m 512 -machine s390-ccw-virtio -cpu max,zpci=on \\\n                    -kernel ./vmlinuz-5.10.0-26-s390x -initrd ./initrd.img-5.10.0-26-s390x \\\n                    -append \"console=ttyAMA0 debug root=/dev/vda rw net.ifnames=0\"\\\n                    -hda ./debian-bullseye-s390x.qcow2 \\\n                    -nographic -nic user,model=virtio,hostfwd=tcp::5555-:22\n```\n\nRefer to [QEMU doc](https://wiki.qemu.org/Documentation/Platforms/S390X) for details.\n\n### PPC\n\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-ppc64 -m 512 -cpu power9 -kernel ./vmlinux-5.10.0-26-powerpc64le \\\n                  -initrd ./initrd.img-5.10.0-26-powerpc64le \\\n                  -append \"console=hvc0 debug root=/dev/sda net.ifnames=0\" \\\n                  -hda ./debian-bullseye-ppc64el.qcow2 -nographic \\\n                  -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n### MIPS\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-mipsel -m 512 -M malta -kernel ./vmlinuz-5.10.0-26-4kc-malta \\\n                   -initrd ./initrd.img-5.10.0-26-4kc-malta \\\n                   -append \"console=ttyAMA0 debug root=/dev/sda net.ifnames=0\" \\\n                   -hda ./debian-bullseye-mipsel-malta.qcow2 -nographic \\\n                   -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full \\\nqemu-system-mips64el -m 512 -M malta -cpu 5KEc -kernel ./vmlinuz-5.10.0-26-5kc-malta \\\n            -initrd ./initrd.img-5.10.0-26-5kc-malta \\\n            -append \"console=ttyAMA0 debug root=/dev/sda net.ifnames=0\" \\\n            -hda ./debian-bullseye-mips64el-malta.qcow2 \\\n            -nographic -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\n### Loongarch64\n\nSo far, Loongarch64 Debian ports are [not complete](https://wiki.debian.org/Ports/loong64) but we can boot Loong Archlinux and run debian userland inside.\n\n```bash\ndocker run -p 5555:5555 -v `pwd`:/work --rm -it lazymio/qemu-full:v8.2.0 \\\nqemu-system-loongarch64 -m 1024m -cpu la464-loongarch-cpu \\\n                    -M virt -append \"console=ttyS0 rw debug root=/dev/vda\" \\\n                    -kernel ./vmlinuz-loong64 -initrd ./initrd.img-loong64 \\\n                    -bios ./bios-loong64-8.1.bin \\\n                    -hda ./debian-bullseye-loong64.qcow2 --nographic \\\n                    -nic user,model=virtio-net-pci,hostfwd=tcp::5555-:22\n```\n\nAfter the system is up, SSH into it and use:\n\n```\n[root@debian-bullseye-loong64 ~]# cd /debian/\n[root@debian-bullseye-loong64 debian]# chroot .\nroot@debian-bullseye-loong64:/# cat /etc/issue\nDebian GNU/Linux trixie/sid \\n \\l\n\nroot@debian-bullseye-loong64:/# uname -a\nLinux debian-bullseye-loong64 6.7.0-rc2-2 #1 SMP PREEMPT Mon, 27 Nov 2023 08:42:49 +0000 loongarch64 GNU/Linux\nroot@debian-bullseye-loong64:/# apt\napt 2.7.7 (loong64)\nUsage: apt [options] command\n\napt is a commandline package manager and provides commands for\nsearching and managing as well as querying information about packages.\nIt provides the same functionality as the specialized APT tools,\nlike apt-get and apt-cache, but enables options more suitable for\ninteractive use by default.\n\nMost used commands:\n  list - list packages based on package names\n  search - search in package descriptions\n  show - show package details\n  install - install packages\n  reinstall - reinstall packages\n  remove - remove packages\n  autoremove - automatically remove all unused packages\n  update - update list of available packages\n  upgrade - upgrade the system by installing/upgrading packages\n  full-upgrade - upgrade the system by removing/installing/upgrading packages\n  edit-sources - edit the source information file\n  satisfy - satisfy dependency strings\n\nSee apt(8) for more information about the available commands.\nConfiguration options and syntax is detailed in apt.conf(5).\nInformation about how to configure sources can be found in sources.list(5).\nPackage and version choices can be expressed via apt_preferences(5).\nSecurity details are available in apt-secure(8).\n                                        This APT has Super Cow Powers.\nroot@debian-bullseye-loong64:/#\n```\n\nOr using a docker approach:\n\n```bash\npacmam -Syu docker\nmkdir -p /etc/docker\n# This is important to avoid ip addresses conflicting with host's docker!\necho \u003e /etc/docker/daemon.json \u003c\u003cEOF\n{\n\t\"default-address-pools\": [\n\t\t{\"base\": \"10.99.0.0/16\", \"size\":24}\n\t]\n}\nEOF\nsystemctl start docker \u0026\u0026 systemctl enable docker\necho \"FROM scratch\" \u003e /debian/Dockerfile\necho \"ADD . /\" \u003e\u003e /debian/Dockerfile\ncd /debian \u0026\u0026 docker build -t debian_rootfs .\ndocker run -it --rm debian_rootfs bash\n```\n\nOnce Debian ports is available we can jump over ArchLinux and boot Debian directly.\n\n## Usage\n\n### SSH\n\nTwo users created: `root:root` and `debian:debian` and ssh server is up by default.\n\n### Resize disk\n\nOn host:\n\n```bash\nqemu-img resize ./debian-bullseye-loong64.qcow2 16G\n```\n\nOn emulated targets:\n\n```bash\nparted /dev/vda resizepart 1 100%\nresize2fs /dev/vda\nreboot\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Fdebianonqemu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwtdcode%2Fdebianonqemu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwtdcode%2Fdebianonqemu/lists"}