Hello everyone !
After OVH, I tried a discount server on Contabo and installed OmniOSce on it.
You can find reasonably priced (discount) servers, such as a Dual 10-Core Intel Xeon (E5-2630v4), 2TB SSD, 256GB RAM for about $100/month.
(specs of the server at the end)
Just select Ubuntu or Debian system when ordering.
For this server, I wrote the cloud.raw image via SSH using dd
.
dd if=/path/image/cloud.raw bs=1M | ssh root@PUBLIC-SERVER-IP "dd of=/dev/sda bs=1M"
It's a quite easy method.
You can use a local Linux/FreeBSD/OpenIndiana/OmniosCE/Tribblix... system (or a VM) to have access to the dd
command and write the image.
On the Contabo console, under Server, click on "Rescue System" and activate the "Debian Rescue (recommended)" mode.
(Keep the provided password safe !)
Log in via SSH using the password provided earlier.
ssh root@PUBLIC-SERVER-IP
List the storage devices connected to the server :
lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 682.9M 1 loop /usr/lib/live/mount/rootfs/filesystem.squashfs
sda 8:0 0 1.8T 0 disk
├─sda1 8:1 0 1M 0 part
├─sda2 8:2 0 2G 0 part
├─sda3 8:3 0 8G 0 part
└─sda4 8:4 0 1.8T 0 part
I have a 2TB SSD on my dedicated server.
So I'm gonna install OmniOSce on it.
Erase the disk (not mandatory.. your choice)
dd if=/dev/zero of=/dev/sda bs=1M
If you don't want to erase the SSD entirely, you really should erase the beginning and the end to be sure that there isn't an old ZFS pool label :
zpool labelclear -f /dev/sda
dd if=/dev/zero of=/dev/sda bs=1M count=100
dd if=/dev/zero of=/dev/sda bs=1M seek=$(( $(blockdev --getsz /dev/sda) * 512 / 1024 / 1024 - 100 )) count=100
The storage support of the remote server is ready to be overwritten by the OmniOSce image.
Download the "omnios-r151052b.cloud.raw.zst" image from "https://downloads.omnios.org/media/stable/" on your own computer (or VM with Linux/FreeBSD/... system).
wget https://downloads.omnios.org/media/stable/omnios-r151052b.cloud.raw.zst
zstd -d omnios-r151052b.cloud.raw.zst
And Now, burn the image with dd
, directly by SSH
dd if=/path/omnios-r151052b.cloud.raw bs=1M | ssh root@PUBLIC-SERVER-IP "dd of=/dev/sda bs=1M"
Reconnect to the Rescue mode of the remote server by SSH, then
zpool import
root@m12518:~# zpool import
pool: rpool
id: 3107707452548507503
state: ONLINE
status: The pool was last accessed by another system.
action: The pool can be imported using its name or numeric identifier and
the '-f' flag.
see: https://openzfs.github.io/openzfs-docs/msg/ZFS-8000-EY
config:
rpool ONLINE
sda ONLINE
Import it !
root@m12518:~# zpool import -f rpool
Mount it
mkdir -p /mnt/root
cat /rpool/boot/menu.lst # to get the correct ROOT folder
# (example : bootfs cloudrpool/ROOT/omnios-r151052)
mount -t zfs rpool/ROOT/omnios-r151052 /mnt/root
Add your public SSH key (from the computer you will finally use to connect to the server.. not from the VM used to transfer the image).
mkdir /mnt/root/root/.ssh
echo "YOUR-PUBLIC-SSH-KEY-HERE" > /mnt/root/root/.ssh/authorized_keys
Export the pool
zpool export rpool
Reboot the server (it will leave the Rescue mode automatically), wait a few minutes, then connect by SSH.
(you will probably need to rm your known_hosts file before).
ssh root@PUBLIC-SERVER-IP
The Contabo web platform keeps telling us it's Ubuntu... but no, it's not anymore :-D.
The installation is over. Congratulations !
But, now, off course, you should :
- deactivate cloudinit
svcadm disable svc:/system/cloud-init:*
svcadm disable svc:/system/cloud-init:initlocal
svcadm disable svc:/system/cloud-init:init
svcadm disable svc:/system/cloud-init:modules
svcadm disable svc:/system/cloud-init:final
- change root password :
passwd root
- create another admin user and connect to it (start a new SSH session)
useradd -m -s /bin/bash "adminusr"
passwd "adminusr"
usermod -G "staff" "adminusr"
# check /etc/sudoers to see if staff has rights :
if ! grep -q "^%staff" /etc/sudoers; then
echo "# sudo configuration for staff group..."
echo "%staff ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
fi
Now, disconnect and reconnect with adminusr, then log with root (sudo su -
).
- destroy omnios default user :
userdel omnios
zfs destroy rpool/home/omnios
- configure SSH (add
AllowUsers root adminusr
for example)
- create an ipadm rescue script (It could be important, so that if you make a mistake, the IP configuration will always be fixed after a reboot)
ipadm # get the name of your NIC (let's suppose "igb0") and the PUBLIC-SERVER-IP (let's suppose 12.23.34.45/24)
netstat -rn # get the IP-GATEWAY (let's suppose 12.23.34.1)
vi /etc/init.d/network-setup.sh # or install "nano" if you don't like "vi" (pkg install nano)
#!/bin/bash
# Erase the IP configurations of the network cards :
ipadm delete-ip igb0 2>/dev/null
# Wait for them to be ready again
sleep 5
# Configure the first interface :
ipadm create-ip igb0
ipadm create-addr -T static -a local=12.23.34.45/24 igb0/v4
# Wait again
sleep 5
# Add the default route :
route -p add default 12.23.34.1
exit 0
Give execution right :
chmod +x /etc/init.d/network-setup.sh
Create a second script that will automatically start our first one (as far as I know, you can only start one script at startup, so it's a trick if you need to start several scripts).
if ! grep -q "nohup /etc/init.d/network-setup.sh &" /etc/init.d/startall.sh; then
echo "nohup /etc/init.d/network-setup.sh &" >> /etc/init.d/startall.sh
fi
Give execution right again :
chmod +x /etc/init.d/startall.sh
Create a symlink to start the script at startup.
ln -s /etc/init.d/startall.sh /etc/rc3.d/S80-startall.sh > /dev/null 2>&1
- Install what you want... etc...
Specs of the remote server :
root@omnios:~# prtdiag
System Configuration: Supermicro Super Server
BIOS Configuration: American Megatrends Inc. 3.1 06/07/2018
BMC Configuration: IPMI 2.0 (KCS: Keyboard Controller Style)
==== Processor Sockets ====================================
Version Location Tag
-------------------------------- --------------------------
Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz CPU1
Intel(R) Xeon(R) CPU E5-2630 v4 @ 2.20GHz CPU2
==== Memory Device Sockets ================================
Type Status Set Device Locator Bank Locator
----------- ------ --- ------------------- ----------------
DDR4 in use 0 P1-DIMMA1 P0_Node0_Channel0_Dimm0
DDR4 in use 0 P1-DIMMB1 P0_Node0_Channel1_Dimm0
DDR4 in use 0 P1-DIMMC1 P0_Node0_Channel2_Dimm0
DDR4 in use 0 P1-DIMMD1 P0_Node0_Channel3_Dimm0
DDR4 in use 0 P2-DIMME1 P1_Node1_Channel0_Dimm0
DDR4 in use 0 P2-DIMMF1 P1_Node1_Channel1_Dimm0
DDR4 in use 0 P2-DIMMG1 P1_Node1_Channel2_Dimm0
DDR4 in use 0 P2-DIMMH1 P1_Node1_Channel3_Dimm0
==== On-Board Devices =====================================
==== Upgradeable Slots ====================================
ID Status Type Description
--- --------- ---------------- ----------------------------
1 available PCI Exp. Gen 2 x4 PCH SLOT1 PCI-E 2.0 X4 (IN X8)
2 available PCI Exp. Gen 3 x8 CPU1 SLOT2 PCI-E 3.0 X8
3 available PCI Exp. Gen 3 x8 CPU1 SLOT3 PCI-E 3.0 X8
4 available PCI Exp. Gen 3 x4 CPU2 SLOT4 PCI-E 3.0 X4 (IN X8)
5 available PCI Exp. Gen 3 x16 CPU1 SLOT5 PCI-E 3.0 X16
6 available PCI Exp. Gen 3 x8 CPU1 SLOT6 PCI-E 3.0 X8
root@omnios:/# prtconf | grep Memory
Memory size: 262031 Megabytes
root@omnios:/#