Start Ubuntu Without Starting The Gnome Desktop (text mode)

If you’ve installed a desktop, such as Gnome, on Linux you may not need it all the time. Some of the time taken to boot your machine when you first turn it on is used by loading the GUI and everything that comes with it. In addition, once it’s loaded it will consume resources such as RAM.

Once you install a desktop such as Gnome, especially on Ubuntu/ Debian, the default is to boot your computer into the GUI.

You could set the desktop not to load by default so that you’re presented with a terminal login screen on boot.

You can then load the desktop, such as Gnome, if you need to or just use the terminal if you don’t.

To disable the Desktop on boot you’ll need to edit the grub config file and edit the GRUB_CMDLINE_LINUX_DEFAULT parameter.

1

vi/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULTwill likely be quiet splash and you’ll need to change that to quiet splash text.

1

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text"

Save and close the file.

The last step is to run the update-grub command to update the grub bootloader config.

1

update-grub

Your computer will now always boot in text mode, that is, without a desktop.

Start the Desktop

If you ever want to start the desktop, log in to the terminal session with your user name and password and run the following:

Oracle have a very restrictive license that applies to most of their software downloads which prohibits you from distributing the binaries yourself. What this means, for example, is that you could not download the Java binaries and upload them to your own APT repository for others to use.

There are a few workarounds that exist to help making this install easier, but here we’re going to look at downloading the Java runtime environment (JRE) binaries and installing them all from a command line.

Use wget to download the binaries, so make sure that’s available on your system. If it isn’t, simply apt-get install wget.

One of the important things to note is that the Java version changes over time and therefore the links and commands below may need to be changed to ensure you’re always getting the latest version. Check out the Java Download Page to make sure you have the latest.

Keeping an eye on all of your containers disk space can be time consuming if done one by one. Luckily, the vzlist command gives us access to many of the data and counters associated with each container.

Running vzlist on it’s own will give a list of the currently running containers and a few extra columns of information such as IP address and hostname.

1

2

3

vzlist

CTID NPROC STATUS IP_ADDR HOSTNAME

10027running10.10.10.10test.jamescoyle.net

You might be thinking that the above command doesn’t show anything about containers which are currently turned off, or about disk space. You’d be right!

Adding the –all switch will include all containers, regardless of their running state.

To add the disk space information we add the –output switch followed by the column names we want to display. For disk space, the column name is helpfully named diskspace so the command will look like this:

1

2

3

vzlist--all--output diskspace

DSPACE

1184648

We now see the disk space of all of our containers, but with a problem. We have no idea (although in this example we do because we only have one container) which container the disk space output is for. We need to add a few more columns to the –output switch such as ctid and hostname. (see below for a complete list of output columns)

1

2

3

vzlist--all--output ctid,hostname,diskspace

CTID HOSTNAME DSPACE

100test.jamescoyle.net1184660

The last trick here is to add a sort using the –sort switch and the column name

1

2

3

vzlist--all--output ctid,hostname,diskspace--sort diskspace

CTID HOSTNAME DSPACE

100test.jamescoyle.net1184660

Let’s put all that together, plus a spot of awk magic to get a nice disk full percentage that we can work with:

There are many web front ends to the OpenVZ virtualisation server which offer varying functionality and are at different stages of development.

Take a look at the OpenVZ Control Panels wiki page for a list and a brief description of what each one does.

One that I have found to be very stable, easy to use and the most feature rich is the OpenVZ Web Panel (OWP). It allows you to create and destroy new OpenVZ containers, manage networking, download new OS templates and a few other things all from a clean web based front end.

Installing the OpenVZ Web Panel

Installing the OpenVZ Web Portal couldn’t be easier – simply run a one-line command on the terminal and let the script do the rest. The script will download all the required dependencies, such as Ruby, and set everything up so that you have a working web address which you can use to administer your OpenVZ server.

Run the below command on your OpenVZ server.

1

wget-O-http://ovz-web-panel.googlecode.com/svn/installer/ai.sh|sh

Once the script completes, the web server will be available on your servers IP or hostname and port 3000. The default username and password, which are required for login are:

Username: admin

Password: admin

If you have iptables installed you will need to add a new rule for the default port 3000.

Matt Martez has kindly created and shared a Python script for interacting with speedtest.net for testing bandwidth to the internet from the command line. This is a great script which only has the dependency of Python – something which is available on most Linux distributions.

Grab the script with wget to the server you wish to test. Remember, this is to test the bandwidth to servers which are publically available on the internet – this does not test your internal server to server communication. See Iperf for details on testing LAN bandwidth.

And that’s all you need to start your first speed test! Run the speedtest-cli with the –simple switch to start your first basic speed test. The script will automatically choose the best server based on your location.

1

2

3

4

./speedtest-cli--simple

Ping:10.331ms

Download:6.47Mbit/s

Upload:5.30Mbit/s

You can use the –help switch to see all the options you have with the tool.

In a previous post, we saw how to create a virtual IP address, based on an existing network interface. The trouble with this method is that the virtual IP address will vanish when you reboot your machine.

On option is to attach the script to the network up and down scripts however there is a much easier way!

In Debian/ Ubuntu you simply create a new, virtual interface in the interfaces file.

1

vi/etc/network/interfaces

And add a network interface, based on an existing interface. The below example is a virtual IP based on eth0 – note if this is your second virtual IP you would use eth0:2, and so on.

1

2

3

4

5

6

auto eth0:1

iface eth0:1inet static

address192.168.100.9

netmask255.255.255.0

network192.168.100.0

broadcast192.168.100.255

You will need to change the IP addresses to match your network. Notice there is no gateway – usually you can only have one gateway per machine.