John Belthoff

Blogging for Migraine Relief

Photon OS

By: John Belthoff - Mon, July 15, 2019

I’ve been running ESXI for years but only recently started playing with VMWare Photon OS. Supposedly Photon is an ESXI optimized version of Linux that’s all set for containers. Yes containers like Docker! Awesome.

Here is what I do to install and configure a base machine. Because there is no Remote SSH the first thing I do is open port 22 for the root user. Then I use Putty as it’s much better than the VMWare Console app. Make sure you know if this is safe to do in your environment:

## Allow remote login
vi /etc/ssh/sshd_config

# Change to PermitRootLogin yes
# Then restart ssh
systemctl restart sshd

After that we update:

tdnf -y update

Next assign a static IP address:

## Create A Static IPv4 - Turn Off IPv6
cd /etc/systemd/network/

cat > 10-static-en.network << "EOF"

[Match]
Name=eth0

[Network]
DHCP=no
IPv6=no
Address=10.118.118.131/24
Gateway=10.118.118.1
DNS=10.118.118.17
DNS=10.118.118.19
Domains=mydomain.net
NTP=10.118.118.1
EOF

chmod 644 10-static-en.network

## either "reboot" or restart the network
systemctl restart systemd-networkd

Update the OS to my Time Zone:

## Change to Local Time - For me it's New York!
timedatectl set-timezone America/New_York

Now let’s start and then enable Docker and while we’re at it let’s also install docker-compose:

## Start and enable Docker - Install docker-compose
systemctl start docker
systemctl enable docker

curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

And we’re done. Simple as that.

What follows are some optional items. Like….

Adding Swap:

## Add Swap
dd if=/dev/zero of=/mnt/swapfile bs=1G count=4
chmod 600 /mnt/swapfile
mkswap /mnt/swapfile
swapon /mnt/swapfile
## Verify
swapon -s
## Update FSTAB
vi /etc/fstab
/mnt/swapfile swap swap defaults 0 0

I hope you found this useful. Because John Belthoff Rocks!