0

Per the title, I want to install Slax (version 9.11.0) to a .img file for use with qemu, as a virtual machine. I've tried a bunch of things over four hours, and I've been unable to do this.

My understanding is with most distributions, you use qemu-img to create a .img file, use qemu-system to boot a .iso file with a .img provided, and most operating systems will provide some sort of "Install to disk" option. After doing so, you can simply boot using qemu-system and the .img. Changes will be saved to the .img.

But Slax is different, and offers no "Install to disk" method. Nothing is stored on the .img. It's acts like a live, non-persistent disk.

Slax still has an installation method. It's easy to create an installer on a physical device (such as a USB), with instructions here: https://www.slax.org/starting.php But I cannot find how to apply this method to a .img file!

Some possibly useful information about what I tried:

I tried to reproduce those instructions by using dd and mkfs to create a .img file with an msdos filesystem, but running the bootinst.sh did not work. With a bit of inspection, I see the script failed around line 127, because extlinux.x64 tried to run and reported cannot find device for path ., cannot open device (null), returning exit code 1. I don't know enough about images and filesystems to diagnose this, but I guess it's because my .img is not a physical device (like a USB.)

1

To install Slax on qemu you need to:

  1. create a hard disk image
  2. boot the image

To create a hard disk image:

qemu-img create slax.img 4G

To boot the image:

qemu-system-x86_64 -hda slax.img -cdrom slax-64bit-9.11.0.iso -boot d -m 512

username is root , password is toor.

Installing Slax:

Open the terminal , install parted , unmount /dev/sda

apt install parted
umount /media/sda

Use fdisk , parted ... to create an ext4 partition

NB

It is required that your disk uses msdos partition scheme (use MBR, not GPT). Furthermore, it needs to be formatted, FAT32 or ext4 is recommended.

partprobe
mkdir /mnt/slax
mount /dev/sda1 /mnt/slax
cp -R /media/sr0/slax/ /mnt/slax/
cd /mnt/slax/slax/boot
./bootinst.sh
cd
umount /mnt/slax
umount /media/sr0
poweroff

Then run:

qemu-system-x86_64 -hda slax.img -boot d -m 1000

Debian wiki: QEMU

4
  • This doesn't install it to create a bootable slax.img though. (Such a thing would work in other distros, but not this one.) – lynn Feb 19 '20 at 15:16
  • @lynn answer update, including how to install slax. – GAD3R Feb 19 '20 at 18:22
  • @lynn have you tried my edit? I have installed slax on qemu, it work without problem. Could you confirm? – GAD3R Feb 24 '20 at 15:00
  • I'm sorry -- I haven't gotten the time to get around to trying this yet. Particularly the fdisk and parted part I would need to learn how to do. – lynn Feb 26 '20 at 17:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.