Objective

The objective is to create a new snapshot of a XenServer virtual machine and later restore from this snapshot.

Requirements

Privileged access to XenServer's command line.

Difficulty

EASY

Instructions

Identify VM's UUID

First, we need to identify a VM's UUID we wish to take a snapshot from. Use xe vm-list to list all available VM:
# xe vm-list
uuid ( RO)           : 7371124f-7d4d-66b7-cbc7-a98b1457543e
     name-label ( RW): Debian Jessie 8.5
    power-state ( RO): halted


uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running


appliance-assert-can-be-recovered
reqd params : uuid
optional params : database:
description : Test whether storage is available to recover this VM appliance.
appliance-create
reqd params : name-label
optional params : name-description
description : Create a VM appliance.

Objective

The objective is to set a new name label on a existing XenServer's VM ( virtual machine ).

Requirements

Privileged access to XenServer's command line as well as configured ISO image storage containing an ISO image of the Linux distribution you wish to install.

Difficulty

EASY

Instructions

Identify VM's UUID

In order to set/rename VM's name label we fisrt need to identify its UUID. List all VM's and take a note of a relevant UUID. Example:
# xe vm-list
uuid ( RO)           : bad8e456-df88-435d-ba12-3f0f6e54b2c6
     name-label ( RW): Control domain on host: xenserver
    power-state ( RO): running


uuid ( RO)           : 699dcb0c-e897-5bd4-30c1-ab1dd9a3ca4e
     name-label ( RW): Debian Jessie 8.0
    power-state ( RO): halted

Objective

Deployment of XenServer virtual machine using command line.

Requirements

Privileged access to XenServer's command line as well as configured ISO image storage containing an ISO image of the Linux distribution you wish to install.

Difficulty

MODERATE

Instructions

Deploy VM template and gather information

In this guide we will be creating a new Ubuntu Linux based virtual machine. However, the below procedure will fit any decent Linux distribution as along as it is supported by XenServer, meaning that the template for the Linux distribution you would like to install is part of the XenServer's repertoire. Let's first search XenServer's database for a template name.

In this case we are looking for Ubuntu 16.04:
# xe template-list | grep name-label | grep -i 16.04
          name-label ( RW): Ubuntu Xenial Xerus 16.04

Objective

The Virtual Machine creation using template provisioner may spawn unnamed VDI disks. Usually, the VID description states Created by template provisioner at most. Example:
uuid ( RO)                : 093e128a-2632-43bd-bb45-8f864bc69d6f
          name-label ( RW): 0
    name-description ( RW): Created by template provisioner
             sr-uuid ( RO): 3ef7b35b-5d39-7414-0c91-bbb281b9a521
        virtual-size ( RO): 21474836480
            sharable ( RO): false
           read-only ( RO): false
The objective is to set a proper name and description to VDI disk.

Installing WINE

Since there are multiple available versions of WINE, there are different ways to install it as well. Of course, each distribution also packages and ships WINE differently, and most only ship one or two versions of it. Thankfully, there are third party repositories available, and, when all else fails, WINE can be compiled from source. Unless you’re running Gentoo, source should probably be the last resort, since it’s obviously harder to maintain, but it can work in cases where you want a custom WINE build that isn’t packaged for your distro.

Introduction

The ability to monitor the temperatures of key components is important, whether you’re gaming, overclocking, or doing something more businesslike and running a critical server. Linux includes modules in the kernel that allow it to access onboard sensors within components. Though, that alone is not enough.

There is a program that does work in conjunction with those modules to display the readings of those sensors in the userspace. That program is lm_sensors. Lm_sensors allows users to get a readout of sensor readings in the command line and interfaces with several graphical front ends that make displaying temperatures in real time automatic and easy.

Installation

Lm_sensors is in nearly every distro’s repositories. In most cases, installation is as simple as a single command. Since it lm_sensors is a daemon, it will need to be started in all distributions, but the Debian based ones, which start it automatically.

Ubuntu

$ sudo apt-get install lm-sensors

Debian

# apt-get install lm-sensors

Objective

Suppose that we have included a new item to our Xenserver's storage repository such as the newly downloaded ISO images. XenServer would not list this item immediately and thus this requires a manual action to include this new item into XenServer's storage repository list. The objective is to rescan XenServer's storage repository thus make all new items available for use.

Requirements

Administrative Local or Remote command line access to XenServer is required to complete this task.

Objective

Iptables rules are by default not persistent after reboot. The objective is to make iptables rules persistent after reboot.

Requirements

Privileged remote or physical access to your Ubuntu or Debian Linux system is required to complete this task.

Difficulty

EASY

Instructions

iptables-persistent installation

In order to make your iptables rules persistent after reboot install iptables-persistent package using apt-get tool:
# apt-get install iptables-persistent

Introduction

One of the main concerns for people making the switch to Linux is how to run the programs that they’ve become accustomed to on other operating systems, mainly Windows. For most, there are one or two programs of games that aren’t available on Linux, and that puts a major hold on adopting Linux full time. Thankfully, WINE can help to solve this problem. introduction to wine on linux

WINE is a piece of software for Unix-like systems, including Linux, OSX, and the BSDs, that allows you to run native Windows applications. WINE stands for, WINE Is Not an Emulator. That’s because it isn’t. WINE isn’t a full Windows install or some kind of VM. It is a compatibility layer that essentially translates Windows binaries. This extends to graphics libraries like DirectX 9, which is converted to OpenGL. WINE allows Linux users to run many popular Windows applications and games at similar performance to if they were running on Windows itself.

Objective

Our objective is to check a disk space usage of one or more local XenServer repositories using Linux shell command line.

Requirements

Remote SSH access to XenServer is required to complete this task.

Difficulty

EASY

Instructions

SSH Login Login

First step is to gain a privileged access to you XenServer using SSH:
$ ssh root@XENSERVER

This config wil examplain how to add new ISO image store on XenServer Linux.

Access XenServer via SSH

First step is to gain an administrative access to your XenServer via ssh.
[root@xenserver ~]#

Let's assume that that you are playing with iptables and wish to remove rules which are no longer valid, required or incorrect. One way of accomplishing this task would be to save all rules using iptables-save command, open the output file, remove all rules and use iptables-restore to apply new rules. Another and perhaps easier way is to list all available rules along with rule line numbers. For example:
# iptables -L --line-numbers
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination         
1    DROP       all  --  anywhere             10.0.0.0/8          
2    DOCKER     all  --  anywhere             anywhere            
3    ACCEPT     all  --  anywhere             anywhere             ctstate RELATED,ESTABLISHED
4    ACCEPT     all  --  anywhere             anywhere            
5    ACCEPT     all  --  anywhere             anywhere            

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination         

Chain DOCKER (1 references)
num  target     prot opt source               destination         
1    ACCEPT     tcp  --  anywhere             172.17.0.3           tcp dpt:https
2    ACCEPT     tcp  --  anywhere             172.17.0.4           tcp dpt:http
3    ACCEPT     tcp  --  anywhere             172.17.0.5           tcp dpt:4000
4    ACCEPT     tcp  --  anywhere             172.17.0.7           tcp dpt:mysql
5    ACCEPT     tcp  --  anywhere             172.17.0.7           tcp dpt:http
6    ACCEPT     tcp  --  anywhere             172.17.0.6           tcp dpt:3142

The Linux Cron time-based scheduler by default does not execute jobs with shorter intervals than 1 minute. This config will show you a simple trick how to use Cron time-based scheduler to execute jobs using seconds interval. Let's start with basics. The following cron job will be executed every minute:
* * * * * date >> /tmp/cron_test
The above job will be executed every minute and insert a current time into a file /tmp/cron_test. Now, that is easy! But what if we want to execute the same job every 30 seconds? To do that, we use cron to schedule two exactly same jobs but we postpone the execution of the second jobs using sleep command for 30 seconds. For example:
* * * * * date >> /tmp/cron_test
* * * * * sleep 30; date >> /tmp/cron_test

The following guide will provide you with simple to follow steps on how to reset your administrative root password on Linux.

Stop MySQL

First, stop MySQL server:
# service mysql stop
 * Stopping MySQL database server mysqld              [ OK ]

Start MySQL server>

Start your MySQL server, but skip all grand privileges and networking:
# mkdir -p /var/run/mysqld
# chown mysql:mysql /var/run/mysqld
# /usr/sbin/mysqld --skip-grant-tables --skip-networking &
[1] 8142

FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in: