Last active
December 14, 2023 08:26
-
-
Save AnshulYbd/36d966712d77c0df5474298170029fc6 to your computer and use it in GitHub Desktop.
setup guide for cmake camapp build setup for 1604 glibc 2.23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install Qemu on windows | |
https://qemu.weilnetz.de/w64/qemu-w64-setup-20221230.exe | |
create empty place holder file 30Gigs | |
qemu-img create -f qcow2 ubuntu-bdg.img 30G | |
download cd boot loaders | |
mkdir netboot | |
cd netboot | |
wget -r -nH -nd -np -R "index.html*" --quiet http://ports.ubuntu.com/ubuntu-ports/dists/xenial/main/installer-armhf/current/images/generic-lpae/netboot/ | |
Run install and create file system | |
qemu-system-arm -M virt -m 1024 -kernel netboot/vmlinuz -initrd netboot/initrd.gz -drive if=none,file=ubuntu-bdg.img,format=qcow2,id=hd -device virtio-blk-device,drive=hd -netdev user,id=mynet -device virtio-net-device,netdev=mynet -nographic -no-reboot | |
extract bootable image initrd and vmlinuz to somefolder say boot | |
qemu-img convert -f qcow2 -O raw ubuntu.img ubuntu-raw.img | |
sudo losetup /dev/loop0 ubuntu-raw.img | |
OFFSET=$(($(sudo fdisk -l /dev/loop0 |grep /dev/loop0p1 |awk '{print $3}')*512)) | |
##OFFSET == 1048576 | |
sudo mount -o loop,offset=$OFFSET /dev/loop0 /mnt | |
Create a new directory boot for the new kernel and initrd files and copy them into it: | |
mkdir boot | |
cp /mnt/initrd.img-4.4.0-210-generic-lpae boot | |
cp /mnt/vmlinuz-4.4.0-210-generic-lpae boot | |
Cleanup: | |
sudo umount /mnt | |
sudo losetup -d /dev/loop0 | |
rm ubuntu-raw.img | |
Boot the image pointing to the extracted boot files, using below command. | |
qemu-system-arm -M virt -m 1024 -kernel ./boot/vmlinuz-4.4.0-210-generic-lpae -initrd ./boot/initrd.img-4.4.0-210-generic-lpae -append "root=/dev/vda2 rootfstype=ext4" -drive if=none,file=ubuntu-bdg.qcow2,format=qcow2,id=hd -device virtio-blk-device,drive=hd -netdev user,id=mynet,hostfwd=tcp::60022-:22 -device virtio-net-device,netdev=mynet -nographic | |
## Ssh from host / outside to guest qemu | |
root@birddog-49357:/tmp# ssh -p61022 [email protected] | |
## Ssh from guest Qemu to host/linux outside | |
master@ub1604-armhf:~$ ssh -p9031 [email protected] | |
or | |
master@ub1604-armhf:~$ ssh [email protected] -p 9031 | |
cmd file can run the attach image qcow2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References
Others------------------------------
https://ubuntu.com/server/docs/network-dhcp
https://wiki.gentoo.org/wiki/QEMU/Options
https://en.wikibooks.org/wiki/QEMU/Images#Mounting_an_image_on_the_host
https://stackoverflow.com/questions/22654634/difference-between-net-user-and-net-nic-in-qemu