In a Fedora Magazine article, I was facing the problem that some VPS providers don’t offer Fedora as an option.

Many of them offer a set of images (usually limited to CentOS, Debian and Ubuntu), and there is no way to upload and use an ISO or an image of your choice. In other words you can’t install a distribution of your choice.

So. What if you want to install and use Fedora IoT on a VPS?

The unorthodox way

Fedora IoT comes as an ISO or as a Raw image.

Let’s suppose that you have a VPS running CentOS (or whatever). Well, a VPS that is not running any service, and you want to convert to Fedora IoT.

This is the command to issue:

1
2
3
curl -s -o - -L \
https://download.fedoraproject.org/pub/alt/iot/33/IoT/x86_64/images/Fedora-IoT-33-20201215.0.x86_64.raw.xz \
| xzcat | sudo dd status=progress bs=4M of=/dev/vda

As soon as finished, reboot the system.

Please take into account that Fedora IoT need a DHCP server and it doesn’t provide a default user/password to log in.

Once rebooted. Log in and expand the file system.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
fdisk /dev/vda

Command (m for help): d
Partition number (1,2, default 2): 2

Partition 2 has been deleted.

Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (2099200-56943039, default 2099200): 
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2099200-56943039, default 56943039): 

Created a new partition 2 of type 'Linux' and of size 26.2 GiB.
Partition #2 contains a ext4 signature.

Do you want to remove the signature? [Y]es/[N]o: n

Command (m for help): w

The partition table has been altered.
Syncing disks.

Then, extend the filesystem.

resize2fs /dev/vda2

What about Fedora Core OS?

Same thing. Also for a FCOS a raw image is provided. So:

1
2
3
curl -s -o - -L \
https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/33.20210117.3.2/x86_64/fedora-coreos-33.20210117.3.2-metal.x86_64.raw.xz \
| xzcat | sudo dd status=progress bs=4M of=/dev/vda

Reboot. And edit the kernel line on GRUB, adding ignition.firstboot and ignition.config.url= pointing to an ignition file.

Final advice

Please read your provider’s TOS if this operation is explicitly disallowed.