Open Jean-Baptiste-Lasselle opened 2 years ago
pkg install qemu-utils qemu-common qemu-system-x86_64-headless
# https://alpinelinux.org/releases/
export ALPINE_VERSION=3.15.0
export ALPINE_MAJOR_VERSION=$(echo "${ALPINE_VERSION}" | awk -F '.' '{ print $1 }')
export ALPINE_MINOR_VERSION=$(echo "${ALPINE_VERSION}" | awk -F '.' '{ print $2 }')
export ALPINE_PATCH_VERSION=$(echo "${ALPINE_VERSION}" | awk -F '.' '{ print $3 }')
echo " ALPINE_PATCH_VERSION=[${ALPINE_PATCH_VERSION}]"
echo " ALPINE_MINOR_VERSION=[]"
echo " ALPINE_MAJOR_VERSION=[${ALPINE_MAJOR_VERSION}]"
mkdir -p alpine.iso/ && cd $_ wget http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_MAJOR_VERSION}.${ALPINE_MINOR_VERSION}/releases/x86_64/alpine-virt-${ALPINE_VERSION}-x86_64.iso
qemu-img create -f qcow2 disque.dur.alpine.img 4G
qemu-system-x86_64 -machine q35 -m 1024 -smp cpus=2 -cpu qemu64 \ -drive if=pflash,format=raw,read-only,file=$PREFIX/share/qemu/edk2-x86_64-code.fd \ -netdev user,id=n1,hostfwd=tcp::2222-:22 -device virtio-net,netdev=n1 \ -cdrom alpine-virt-${ALPINE_VERSION}-x86_64.iso \ -nographic disque.dur.alpine.img
* The VM creation process will end with the login into the new VM. Login with user root (no password)
```bash
# Setup network (press Enter to use defaults):
setup-interfaces
# Available interfaces are: eth0.
# Enter '?' for help on bridges, bonding and vlans.
# Which one do you want to initialize? (or '?' or 'done') [eth0]
# Ip address for eth0? (or 'dhcp', 'none', '?') [dhcp]
# Do you want to do any manual network configuration? [no]
# --> then activate netw interface
ifup eth0
# localhost:~# ifup eth0
# Et moi je vais balancer de la VM avec 1 Gigas de RAM, non pas 4 Ggias
qemu-system-x86_64 -enable-kvm -m 1G -hda naugat-pre.img -vga std -netdev user,id=net0 -device virtio-net-pci,netdev=net0
# --> here there are a few instructions to follow, to update / activate new pkg repositories
apt update -y && apt upgrade -y && apt update -y
# --> see https://github.com/termux/termux-packages/wiki/Package-Management
termux-change-repo
# --> now install git, and openssh client and server packages
pkg install git openssh
# --> installing the 'openssh' package will cause the geenration of rsa and ecdsa key pairs
# --> we will not touch all those key pairs, and generate a new one to
# add to SSH Keys to our Github Users :
# this will be done by installation process, using
# github OAuith2, and therefore will be done by npm run preps:all
# well actually no, we could curl over https://, without SSH Key pair
# the npm scripts and package.json, to run npm run:preps:all, and
# actually
# + in termux, $HOME = /data/data/com.termux/files/home
mkdir -p ${HOME}/.pokus/.ssh/
chmod 700 -R ${HOME}/.pokus/.ssh/
ssh -keygen -t rsa -b 4096 -C "pokusbox@mobile.jbl.pokus.io" -P '' -f ${HOME}/.pokus/.ssh/pokusbox_git_key
ls -alh ${HOME}/.pokus/.ssh/
git clone git@github.com/:okusio/passportjs-quickie.git pokusbox/
cd pokusbox/
# will run :
npm run preps:android
npm run preps:android
It is possible to run KVM QEMU and get ip address for the VM :
kubeadm join