Playing with Alpine VM



Let’s say you need to play/learn virtualization on linux but you are system has pretty low specs then what would you do ? we would use a low foot print linux distro, I choosed Alpine

Before we start, we need to download the alpine iso, Alpine offers wide variety of iso. you can download the iso from

Okay let’s boot up Virtual Box and Create a new VM Type : Linux Version: Other Linux(64 Bit) no other special option, just go with default option.

Before booting the server, let’s set the networking.

Networking

Booting

Setting up network

ifconfig -a
ifconfig lo up
ifconfig eth0 up
vi /etc/network/interfaces
iface eth0 inet dhcp
ifup eth0

Checking network connection

nc -l -p 4444
nc localhost 4444

Setting up SSH Server

apk add openssh
rc-update add sshd
rc-status
vi /etc/ssh/sshd_config
PasswordAuthentication no
/etc/init.d/sshd start

SSH Connection between Guest and Host

ssh-keygen
nc -l -p 4444 > ~/.ssh/authorized_keys # On VM
nc localhost 4444 < ~/.ssh/id_rsa.pub # On Host
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
/etc/init.d/sshd restart
ssh -i ~/.ssh/id_rsa.pub root@localhost -p 2200

The VM is created for demo purpose if you are using it for real projects, read below heading

Do’s and Don’t

ssh-copy-id -i path/to/certificate -p port username@remote_host

In next article we can look into how to communicate between two Alpine VM.

Resources