简体   繁体   中英

Running alpine Linux with qemu

I have try to run an alpine Linux in an emulated environment this way:

$ wget https://dl-cdn.alpinelinux.org/alpine/v3.16/releases/x86/alpine-netboot-3.16.1-x86.tar.gz

I have untar the archive and run:

qemu-system-i386 -m 256 -kernel boot/vmlinuz-lts -initrd boot/initramfs-lts -append "console=ttyAMA0 ip=dhcp alpine_repo=http://dl-cdn.alpinelinux.org/alpine/edge/main/" -virtfs local,path=/xxxx/mylocalfolder,mount_tag=mytag1,security_model=passthrough -nographic 

My terminal is blank. I need to remove the -nographic argument to make it work. It works fine without this argument? But i need to run it through ssh so how can How can i do ?

I want to share a folder between the host machine and the emulated computer (see virtfs option). Here is what i've type in the virtual machine:

mount -t 9p -o trans=virtio mytag1 /mnt

I get this error:

mount: mounting mytag1 on /mnt failed: No such device

I do not understand why. Any idea?

I will have to run several times the qemu-system-i386 command. I How can i automatically run commands on the virtualized environnement when it is up? (apk add for example) And is it possible to specify an alpine_repo which is a local file instead of http?

Thanks a lot

Something is strange about your command line. You're running an i386 kernel, but you pass "console=ttyAMA0". ttyAMA0 is the typical serial terminal device name for Arm boards, not for x86 PCs. Where did you get this command line from?

The terminal is therefore blank because you have not correctly told the guest to use a valid serial terminal device for the hardware it's running on. (It's also possible that the guest needs further configuration to work with a serial terminal: typically x86 PCs do not use serial consoles, so guest OSes are often not set up to work that way out of the box.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM