How to have QEMU?

Hi, termux says: Error: Unable to locate package qemu-system-x86_64. When I search it has a long list of qemu_something.. I would like to learn about OS and system programming. Is the safest installation: qemu-system-x86-64-headless? What is the difference "headless" make? Thanks,
12 Replies
owokitty
owokitty4w ago
please use pkg install x11-repo then try again also the correct package name is qemu-system-x86-64 not qemu-system-x86_64 so the command would be pkg install qemu-system-x86-64 and the difference is that qemu-system-x86_64 from package qemu-system-x86-64 is able to show a GUI but qemu-system-x86_64 from qemu-system-x86-64-headless is not able to show a GUI only CLI in order to see the GUI you would need to also install the Termux:X11 addon and set it up
owokitty
owokitty4w ago
GitHub
GitHub - termux/termux-x11: Termux X-server add-on.
Termux X-server add-on. Contribute to termux/termux-x11 development by creating an account on GitHub.
owokitty
owokitty4w ago
however, the package qemu-system-x86-64 is safe to use for either because it does not remove any functionality that qemu-system-x86-64-headless has, it only adds more functionality (and takes more space) so if you want, you could install it and then use it without the GUI, it would just automatically work with whatever interface is available (as long as the guest operating system that you boot using the QEMU has a text mode CLI and does not require a GUI, for example if you boot Linux or BSD inside QEMU it can usually automatically show a text mode CLI, but if you need to boot Windows or MacOS inside QEMU then that would require the GUI to be enabled and activated otherwise you can't really see anything, this seems like something that would make sense to guess but just so you know I also know that from experience of actually testing all OS inside QEMU)
Linh Chi Nguyen
Linh Chi NguyenOP3w ago
Error: Package 'qemu-system-x86-64' has no installation candidate Btw, do you use qemu, what do you use it for?
owokitty
owokitty3w ago
did you use the command pkg install x11-repo first? I do use QEMU, and I use it mainly to run ARM code on x86 computers, but also for other tasks. Because I use it to run ARM code on x86 computers, I don't often use it on phones which already have ARM CPUs, and mostly I use it on PCs which have x86 CPUs
Linh Chi Nguyen
Linh Chi NguyenOP3w ago
I want to simulate a x86 machine. To learn to write a kernel in C. So probably I need to install a Debian on termux. I have a windows machine so this android is the Linux I have
owokitty
owokitty3w ago
You don't really need to install a Debian on termux, you can install qemu-system-x86-64 or qemu-system-x86-64-headless and it would work for what you need, to write a custom kernel. did you use the command pkg install x11-repo and try pkg install qemu-system-x86-64 again after that?
Linh Chi Nguyen
Linh Chi NguyenOP3w ago
It says qemu-system-x86-64 has no candidate Ah so x86-64 is in x11-repo? Let me try
owokitty
owokitty3w ago
Yes
FZXO
FZXO3w ago
you should know that the emulation will be SO SLOW.
owokitty
owokitty3w ago
if kernel is written from scratch it actually won't be because small os have small code and run fast in qemu
Linh Chi Nguyen
Linh Chi NguyenOP3w ago
I'm on android, without cross chain tool, I cannot go further than making the kernel printing some messages So the kernel is in 16 bit real mode, cannot enter 32 bit protected mode, no paging, no multitask, no 64 bit long mode

Did you find this page helpful?