Skip to content

Instantly share code, notes, and snippets.

@thebsdbox
Created January 27, 2021 16:49
Show Gist options
  • Save thebsdbox/e84aeff4ad071969c7b000271d868bbe to your computer and use it in GitHub Desktop.
Save thebsdbox/e84aeff4ad071969c7b000271d868bbe to your computer and use it in GitHub Desktop.
Cloud - to bare metal.sh
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