8Aug/192

Installation of a graphical user interface for Linux

All Linux-Server operating systems are installed by default without a graphical user interface (GUI). A GUI on a dedicated server can only be accessed if a KVM is connected.
This tutorial will guide you through an easy installation process of the two most common GUIs for Ubuntu, Debian and CentOS.
Please note that you will always have to create an additional user for your GUI login, since a login as root is not possible.
In order to access your GUI, you need to use your VPS VNC connection, or access your dedicated server via KVM. KVM access has to be ordered additionally for our dedicated servers, it is not included by default.

Also please be informed that VNC is NOT an encrypted connection method. We recommend to use xRDP if you plan on using your sevrer exclusively with a GUI.

Ubuntu 16.04 / 18.04

Please connect to your server as root via SSH.
Create a new user for your GUI login and set a password:

useradd -m NewUserName && passwd NewUserName

Now you can install the Ubuntu-Dekstop GUI with the following command (the server will fetch updates, install the GUI, and reboot automatically):

apt update && apt upgrade -y && apt install ubuntu-desktop -y && init 6

Alternatively, the following command installs the Kubuntu-Desktop (the server will fetch updates, install the GUI, and reboot automatically):

apt update && apt upgrade -y && apt install kubuntu-desktop -y && init 6

You can connect to your VPS via VNC and login to your new GUI, or via KVM if you have a dedicated server.

Ubuntu 18.10 and later versions

Please connect to your server as root via SSH.
Create a new user for your GUI login and set a password:

useradd -m NewUserName && passwd NewUserName

You can choose from a variety of GUIs, which will automatically be installed with the "tasksel" tool:

apt update && apt upgrade -y && tasksel

Choose a desktop of your liking and confirm, please do not install multiple desktop environments at the same time. Reboot your server to make your GUI accessible via your VPS VNC access or KVM in case of a dedicated server.

CentOS 6

Please connect to your server as root via SSH.
Create a new user for your GUI login and set a password:

useradd -m NewUserName && passwd NewUserName

Now you will need to edit your "/etc/inittab" to boot to runlevel 5 so that you will be able to use the GUI after (re)boot:

nano /etc/inittab

Please change the following line:

id:3:initdefault: -> id:5:initdefault:

Save your changes and close the editor by pressing strg+o, enter, strg+x.

The following command will update your server and install the GNOME GUI and required software (the server will be rebooted automatically):

yum update -y && yum -y groupinstall "Desktop" "X Window System" "Fonts" && init 6

Now you can access your GUI via your VPS VNC access or KVM in case of a dedicated server.

In order to install the KDE GUI, please use the following command. Your server will also be updated and rebooted:

yum update -y && yum -y groupinstall "KDE desktop" "X Window System" "Fonts" && init 6

Now you can access your GUI via your VPS VNC access or KVM in case of a dedicated server.

CentOS 7

Please connect to your server as root via SSH.
Create a new user for your GUI login and set a password:

useradd -m NewUserName && passwd NewUserName

Now you can install the KDE GUI with the following command (the server will fetch updates, install the GUI, and reboot automatically):

yum update -y && yum -y groupinstall "KDE Plasma Workspaces" && ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target && init 6

As alternative the following command for an installation of the GNOME GUI (the server will update and reboot automatically):

yum update -y && yum -y groupinstall "GNOME Desktop" "Graphical Administration Tools" && ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target && init 6

You can connect to your VPS via VNC or KVM in case of a dedicated server and login to your new GUI.

Debian 8 and later versions

Please connect to your server as root via SSH.
Create a new user for your GUI login and set a password:

useradd -m NewUserName && passwd NewUserName

Now you can install the GNOME GUI with the following command (the server will fetch updates, install the GUI, and reboot automatically):

apt update && apt upgrade -y && apt install gnome -y && init 6

As an alternative the following command for an installation of the KDE GUI (the server will update and reboot automatically):

apt update && apt upgrade -y && apt install kde-standard -y && init 6

Now you can connect to your VPS via VNC or KVM in case of a dedicated server and login to your new GUI.

Posted by: Philipp | Tagged as: , , , , , 2 Comments
9Feb/170

Advantages of ZFS

ZFS as a rather new filesystem offers various advantages in comparison to regular filesystems like ext3, ext4 and NTFS. We have summarized the most noticeable ones as follows:

The main benefit of using a ZFS filesystem is guaranteed data integrity

ZFS protects your data by enabling volume management on filesystem level. This feature makes “Copy on Write” (CoW) technology possible. When a block of data is altered, it will change its current location on the disk before the new write is finished. If your system crashes or loses power in the process, that data would be lost or damaged. ZFS does not change the location of the data until the write is completed and verified, thus keeping your data safe in case of a system crash. To verify data integrity, ZFS uses checksums to ensure that the data remains original from write to write. This means that every write is tested, which in turn eliminates bit rot. ZFS not only protects your data with the CoW feature, but offers additional RAID protection in comparison to standard RAID levels. RAID-Z3 allows for a maximum of three disk failures in a ZFS pool. Regular RAID only allows for two disk failures per volume. ZFS offers the ability to set up a multi-disk mirror (nRAID). Usually the RAID mirrors are composed of a single disk and its copy. With a multi-disk mirror you can have multiple copies, which adds levels of data integrity not found in typical RAID setups and is great for read speeds.

Highly Scalable

The storage capacity of ZFS is years ahead of what might become a problem soon for regular filesystems. The possible maximum of a ZFS storage pool is 6 EiB = 16 * 2^60 Byte, which is as much as 3,000,000 6TB HDDs. A configured ZFS pool can easily be changed in its size to accommodate a growing need for more storage. The pool can be upgraded step by step with larger disks, without compromising the filesystem or complicated procedures. Harddisks can even be added on different physical ports or in a changed order in a new computer system, as long as the ZFS version on the target system is the same or higher. You will be able to use your migrated data as soon as the import is completed.

Improved Performance

ZFS also allows to send writes to individual physical disks, instead of just the RAID volume. Because of this, ZFS can stripe writes across RAID volumes, which is speeding up write performance. In the case you need to sync mirrors with only a little bit of information, you do not have to wait for it to sync any of the empty disk space, which can take a good amount of time. ZFS incorporates algorithms to ensure that your most recently used and most frequently used data are kept in the fastest system storage media. Spinning disks are known to be slow and SSD drives come at a very high price compared to regular disks. By using these algorithms in combination with flash-based ZFS write cache and L2ARC read cache devices, you can speed up your performance by up to 20% at low cost. Other great feature of ZFS are the intelligently designed snapshot, clone, and replication functions. ZFS snapshots only update based on what has changed since the last snapshot. This means that clone and replication tasks are less time consuming compared to traditional replication technology.

Easy to administer

Creating a new ZFS-Pool is fairly simple. The available storage devices can be listed with “rmformat” and can be created with the “zpool create -m /mountpunkt Contabo1 DEVICE” command. The new filesystem is automatically mounted and immediately accessible. There is no need to format the new ZFS-Pool. If additional storage space is needed, you can easily add a new device with the “zpool add Contabo1 DEVICE” command. This compares to the classical RAID 0 in which the data is distributed on all available devices.
In general a setup for data integrity is much more adviseable. With the “zpool create Contabo1 mirror DEVICE DEVICE” command you can easily create a ZFS-Pool with mirrored disks as in comparison to a classical RAID 1. You can also add several mirror disks to enhance data integrity even more with the “zpool create Contabo1 raidz DEVICE DEVICE DEVICE DEVICE” command for example. This will create a ZFS-Pool with four disks, in which one is allowed to fail without issues. When using the raidz2 option instead of raidz, two disks can fail at a time.

There is also the option to add Hot-Spares to a ZFS-Pool in order to have a replacement disk ready at all times. If a live disk fails the Hot-Spare will be used automatically to start a rebuild and take the place of the failed disk. This can be done with the “zpool add Contabo1 spare DEVICE” command, which will add the last disk in our example to the pool as Hot-Spare.
With "zpool list" you can review all existing ZFS-Pools with size, usage and health status.
With “man zfs” and “man zpool” you can review the commands that will give you full control over your ZFS-Pools.

A short overview of the mostly used commands:

- Creating a RAID-Z pool
zpool create NAME raidz DEVICE DEVICE DEVICE
- Creating a mirrored pool
zpool create NAME mirror DEVICE DEVICE
- Listing of available pools
zpool list
- Show I/O for all pools
zpool iostat 1
- Show attributes of pool devices
zpool vdevs
- Add disk to a pool
zpool add NAME DEVICE
- Delete a pool
zpool destroy NAME
- Creating and mounting a ZFS-Pool
zfs create POOL/NAME
- List pool filesystems
zfs list
- Creating and mounting a ZFS-Pool on a non-default mountpoint
zfs create POOL/NAME /MOUNTPOINT
- Create a snapshot of a filesystem
zfs snapshot POOL/FILESYSTEM@SNAPSHOTNAME
- Mount a ZFS-Pool
zfs mount POOL/FILESYSTEM /MOUNTPOINT
- Delete a ZFS-Pool
zfs destroy POOL/NAME

Which operating systems are compatible with ZFS?

ZFS was initially designed for Solaris, but can be used today on FreeBSD, FreeNAS, Proxmox and most linux distributions.

Posted by: Philipp | Tagged as: , , , , , No Comments
8Sep/160

Comparison of the different Linux distributions available at Contabo

As a valued customer of Contabo you have access to a variety of different Linux distributions, for use on all of our servers. These can be easily and automatically installed via our powerful customer control panel, which results in various benefits for our customers:

- Contabo always provides the latest versions for installation on all servers.

- You can conveniently and comfortably choose and switch between the offered Linux distributions at any time.

- All Linux distributions are offered free of any costs or fees.

- From the beginner towards the enthusiast, up to commercial professional use, all requirements can be met with the distributions offered by Contabo.

CentOS:

CentOS (Community Enterprise Operating System) is a Linux distribution based on Red Hat Enterprise Linux (RHEL). It is maintained by an open group of voluntary developers, which take care of maintenance and development. As opposed to RHEL, you can use this operating system without mandatory support contracts and free of charge.

WHMs cPanel is developed for this operating system in particular, which makes this Linux distribution a must have for resellers. As an enterprise operating system it is developed with stability and long-term maintenance cycles in mind. All CentOS versions can be used for 10 years without the need to migrate packages and software versions, which makes it an ideal solution for commercial use.

https://www.centos.org/

Debian:

Debian is another Linux distribution that is composed completely of free software, most of which is under the GNU General Public License.

Long term support was first introduced with version 7 for almost all available software packages that use the architectures i386 and AMD64 (32bit- and 64bit-PC-systems). The Debian Project aims to provide 5 years long-term support with security and bug fixes for all versions from 7 upwards. This Linux distribution has access to online repositories that contain over 50,000 software packages, making it one of the largest software compilations available. Debian officially contains only free software, but non-free software can be downloaded and installed as well if needed. This makes it a valid solution for commercial use, as well as a versatile operating system for the regular user.

https://www.debian.org/

Ubuntu:

Ubuntu is a Linux distribution that is strongly based on and influenced by Debian. The goal of the developers was to create an operating system that is as easy to use as possible. It is one of the most commonly used distributions available today. The development team also releases long term support versions of Ubuntu, which are indicated by “LTS” at the end of the version number.

http://www.ubuntu.com/

OpenSUSE:

The focus of its development is creating usable open source tools for developers and administrators, while providing a user friendly desktop and server environment. A unique feature of this distribution is its specialized installation and configuration tool YaST (“Yet another Setup Tool“), which is a central administrative tool for the OpenSUSE operating system. It also helps finding new software and packages for the OpenSUSE distribution.

https://en.opensuse.org/Main_Page

Fedora:

Compared to other Linux distributions, Fedora does not aim for long term support. The life cycle of a Fedora version is 13 months only. Every 6 months a new version is released by the development team. Owing to this circumstance, Fedora is not suited for long-term usage on systems.

On the other hand, you have always access to the latest software developments available. Being state of the art has never been this comfortable. Enthusiasts that are eager to try out the latest developments on the market should always consider using Fedora.

https://getfedora.org/en/

Posted by: Philipp | Tagged as: , , , , , , No Comments
5Aug/152

How to use VNC to connect to your VPS

This is a short instruction on how to login to your VPS via VNC:

We recommend to use UltraVNC to connect to the server. Here is a download link for this tool:

http://www.uvnc.com/downloads/ultravnc.html

It is sufficient to install the VNC client. We do not recommend to install a VNC server on your local computer.
Please start the program and enter your data into the <Host-IP address>:<VNC port> field. The port number and IP address can be found in our initial e-mail to you that contained your login credentials. An example:

120.120.120.120:65432

After entering this information, please press the button 'connect' and type in your initial password.

Please keep in mind to always check your spelling, since the login is case sensitive. Also look out for your keyboard layout, to prevent any mishaps during the login (Y and Z might be switched due to a different keyboard layout). In order to test which keyboard layout is active, you can enter a few test characters at the login prompt and remove them again before entering your actual login name.

Please keep in mind that the VNC access is not as safe as a connection via SSH or RDP. You should always prefer SSH or RDP. Sometimes, neither is possible. Then, VNC is your best option. Remember to always log out of the operating system after you have finished your work! The logout does not happen automatically with VNC since VNC is independent of your operating system.

Please keep in mind that the IP for the VNC access is different from your servers IP. The connection will not work if you use your servers IP instead of the one provided by us.

Posted by: Philipp | Tagged as: , , , , 2 Comments
5Aug/150

How to check the health of your hard drive with smartmontools (in Linux)

A) Installation

To install smartmontools please type the following:

-Debian and Ubuntu-

apt-get install smartmontools

-CentOS-

yum install smartmontools

The above commands will install smartmontools on your system.

 

B) How to use smartmontools

At first, you have to determine the label of your disks. To do so please type the following:

fdisk -l

It will look similar to this:

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 19269 154778211 83 Linux
/dev/sda2 19270 19457 1510110 5 Extended
/dev/sda5 19270 19457 1510078+ 82 Linux swap / Solaris
system1:~#

In this case the disk has the label '/dev/hda'. Apart from "hdX", you will often encounter "sdX". It does not make sense to use smartmontools to test a RAID array (/dev/md0, for example).

With the information of the disks label, we can start smartctl as follows:

smartctl -a /dev/hda

The output will look something like this:

system1:~# smartctl -a /dev/hda
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: ST3160022ACE
Serial Number: 5JS3XTZX
Firmware Version: 9.01
User Capacity: 160,041,885,696 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 6

ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2
Local Time is: Tue Apr 8 18:58:44 2008 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Disabled

SMART Disabled. Use option -s with argument 'on' to enable it.
system1:~#

 

SMART is disabled in this example. To enable it, please type:

smartctl -s on -a /dev/hda

The output will be a detailed report of your disks current status and health, that would look similar to this:

system1:~# smartctl -s on -a /dev/hda
smartctl version 5.36 [i686-pc-linux-gnu] Copyright (C) 2002-6 Bruce Allen
Home page is http://smartmontools.sourceforge.net/

=== START OF INFORMATION SECTION ===
Device Model: ST3160022ACE
Serial Number: 5JS3XTZX
Firmware Version: 9.01
User Capacity: 160,041,885,696 bytes
Device is: Not in smartctl database [for details use: -P showall]
ATA Version is: 6
ATA Standard is: ATA/ATAPI-6 T13 1410D revision 2
Local Time is: Tue Apr 8 18:59:14 2008 CEST
SMART support is: Available - device has SMART capability.
SMART support is: Disabled

=== START OF ENABLE/DISABLE COMMANDS SECTION ===
SMART Enabled.

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status: (0x82) Offline data collection activity
was completed without error.
Auto Offline Data Collection: Enabled.
Self-test execution status: ( 0) The previous self-test routine completed
without error or no self-test has ever
been run.
Total time to complete Offline
data collection: (15556) seconds.
Offline data collection
capabilities: (0x5b) SMART execute Offline immediate.
Auto Offline data collection on/off support.
Suspend Offline collection upon new
command.
Offline surface scan supported.
Self-test supported.
No Conveyance Self-test supported.
Selective Self-test supported.
SMART capabilities: (0x0003) Saves SMART data before entering
power-saving mode.
Supports SMART auto save timer.
Error logging capability: (0x01) Error logging supported.
General Purpose Logging supported.
Short self-test routine
recommended polling time: ( 1) minutes.
Extended self-test routine
recommended polling time: ( 111) minutes.

SMART Attributes Data Structure revision number: 10
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
1 Raw_Read_Error_Rate 0x000f 059 056 006 Pre-fail Always - 163692057
3 Spin_Up_Time 0x0003 096 096 000 Pre-fail Always - 0
4 Start_Stop_Count 0x0032 100 100 020 Old_age Always - 0
5 Reallocated_Sector_Ct 0x0033 100 100 036 Pre-fail Always - 0
7 Seek_Error_Rate 0x000f 100 253 030 Pre-fail Always - 722959
9 Power_On_Hours 0x0032 100 100 000 Old_age Always - 55
10 Spin_Retry_Count 0x0013 100 100 097 Pre-fail Always - 0
12 Power_Cycle_Count 0x0032 100 100 020 Old_age Always - 37
194 Temperature_Celsius 0x0022 039 046 000 Old_age Always - 39
195 Hardware_ECC_Recovered 0x001a 059 056 000 Old_age Always - 163692057
197 Current_Pending_Sector 0x0012 100 100 000 Old_age Always - 0
198 Offline_Uncorrectable 0x0010 100 100 000 Old_age Offline - 0
199 UDMA_CRC_Error_Count 0x003e 200 199 000 Old_age Always - 0
200 Multi_Zone_Error_Rate 0x0000 100 253 000 Old_age Offline - 0
202 TA_Increase_Count 0x0032 100 253 000 Old_age Always - 0

SMART Error Log Version: 1
ATA Error Count: 0
CR = Command Register [HEX]
FR = Features Register [HEX]
SC = Sector Count Register [HEX]
SN = Sector Number Register [HEX]
CL = Cylinder Low Register [HEX]
CH = Cylinder High Register [HEX]
DH = Device/Head Register [HEX]
DC = Device Command Register [HEX]
ER = Error register [HEX]
ST = Status register [HEX]
Powered_Up_Time is measured from power on, and printed as
DDd+hh:mm:SS.sss where DD=days, hh=hours, mm=minutes,
SS=sec, and sss=millisec. It "wraps" after 49.710 days.

SMART Selective self-test log data structure revision number 1
SPAN MIN_LBA MAX_LBA CURRENT_TEST_STATUS
1 0 0 Not_testing
2 0 0 Not_testing
3 0 0 Not_testing
4 0 0 Not_testing
5 0 0 Not_testing
Selective self-test flags (0x0):
After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

system1:~#

In this example the disk is currently healthy and has no recorded errors. All important values have been highlighted in orange in this example for your convenience. To find out more about the capabilities of smartmontools, please refer to the smartctl manual page by typing:

man smartctl

Some S.M.A.R.T. values you should look out for:

Reallocated_Sector_Count

Anything else than '0' is bad. The severity of the disk damage depends on when the drive got the reallocated sectors and how long ago. If the last bad sector was reallocated one year ago the disk is in no immediate danger, as the problem has appeared, been fixed and has not come back. If a bad sector shows up, you will likely get more over time and the general statistic is that a disk that starts to get bad sectors will be defective within six months.

Current_Pending_Sector

This means that sectors are awaiting an upcoming recheck to see if there really is a problem. One encounters these when the operating system is broken and the disk already has a few bad sectors.

Offline_Uncorrectable

The disk is most likely in a bad health state, but this only becomes certain with more writes.

UDMA_CRC_Count

This can be a serious problem and is generally due to defective cables. Simply replacing the cable will be sufficient since the hard disk itself is not affected. If the data cable has been checked and the error persists, there are only a couple of other options. The motherboard or disk are causing 'soft faults'. We recommend to have your server checked completely in this case.

Please keep in mind that using smartmontools or memtest on a VPS will always show wrong results, due to the fact that the hardware is per definition virtualized. Rest assured that Contabo will always check the health of all disks on the VPS host-systems. You will not need to check this for yourself.