Created
January 27, 2021 16:49
-
-
Save thebsdbox/e84aeff4ad071969c7b000271d868bbe to your computer and use it in GitHub Desktop.
Cloud - to bare metal.sh
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
modprobe nbd | |
qemu-nbd --connect=/dev/nbd0 ./focal-server-cloudimg-amd64.img | |
partprobe /dev/nbd0 | |
mkdir /mnt/image | |
mount /dev/nbd0p1 /mnt/image | |
cd /mnt/image | |
mount -t proc /proc proc/ | |
mount --rbind /sys sys/ | |
mount --rbind /dev dev/ | |
chroot /mnt/image bash | |
mv /etc/resolv.conf /etc/resolv.conf.backup | |
echo nameserver 8.8.8.8 > /etc/resolv.conf | |
apt-get update; apt-get install -y linux-modules-extra-5.4.0-62-generic | |
mv /etc/resolv.conf.backup /etc/resolv.conf | |
exit | |
cd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment