How to Download and Burn YouTube Videos on a DVD in Linux

This is a short tutorial on how to burn YouTube videos on a DVD. It might come in handy if you want to watch them on a big TV, or if you want to send them to friends. Or maybe you published them on YouTube for your small business, and you need to send a copy to a client. There are basically three steps: downloading, converting the video to MPEG format, and building the DVD image. All these steps can be accomplished in Linux with free open-source programs.

Downloading

An easy way to download is to use Video DownloadHelper Firefox extension. It is just a mater of starting the video in YouTube and saving it – always choose the highest quality version available when saving.

Video DownloadHelper Mozilla Extension

Video DownloadHelper Mozilla Extension

Converting videos to MPEG format

The main open-source programs for processing videos are FFmpeg and MEncoder. Both of them support a wide range of video formats. My preferred solution is FFmpeg, installed as sudo apt-get install ffmpeg on Ubuntu/Debian systems. I run it as follows:

$ ffmpeg -i input-video.flv -target ntsc-dvd -aspect 16:9 \
-vf "hqdn3d" output-video.mpeg

North American users would use ntsc-dvd, while in some other places pal-dvd would be more appropriate. hqdn3d is a high quality 3D denoiser, applied to the input video using -vf option. If the video has a logo, you can get rid of it using delogo filter:

$ ffmpeg -i input-video.flv -target ntsc-dvd -aspect 16:9 \
-vf "delogo=20:25:100:38:4, hqdn3d" output-video.mpeg

delogo filter takes a rectangular region in its parameters (x1:y1:x2:y2) and fills it up based on its surroundings. You can find a full list of filters available for FFmpeg here.

Sometimes you might want to process only a portion of the input video. You can extract it using -ss to specify the start time in seconds, and -t to specify the duration in seconds. For example to extract a video of 300 seconds in length starting from second 60, the command looks like this:

$ ffmpeg -sameq -ss 60 -t 300 -i input-video.flv output-video.mpeg

I also use FFmpeg for mp3 conversion:

$ ffmpeg -i input-video.flv -f mp3 -ab 192000 audiofile.mp3 

Building the DVD image

With all the videos converted to MPEG format, it is time to build a DVD filesystem structure and to create the ISO file. My preferred program in this case is DVDAuthor (sudo apt-get install dvdauthor). The program generates the file and directory structure of the DVD video disc. It is a professional-grade DVD authoring solution for Linux and it is driven by XML configuration.

Start by moving all the .mpeg files in a new directory and edit a text file dvd.xml:

<dvdauthor dest="DVD">
   <vmgm />
   <titleset>
     <titles>
       <video widescreen="nopanscan" />
       <pgc>
         <vob file="video1.mpeg" chapters="0,10:00,20:00,30:00"/>
       </pgc>
       <pgc>
         <vob file="video2.mpeg" chapters="0,10:00,20:00"/>
       </pgc>
     </titles>
   </titleset>
</dvdauthor>

Add alt the .mpeg files using <vob /> tag, you can also specify chapters for each one of them. The next step is to run DVDAutor tool on dvd.xml file and to generate the ISO file:

$ export VIDEO_FORMAT=NTSC
$ dvdauthor -x dvd.xml
$ mkisofs -V MYDVD -o mydvd.iso -dvd-video DVD

Set VIDEO_FORMAT to PAL if you need to.

There are a number of GUI front-ends for DVDAuthor. I use them sometimes to create DVD menus. I particularly like DVDStyler (sudo apt-get install dvdstyler):

DVDStyler

DVDStyler

Testing and burning the ISO image

To verify the DVD image before burning it, I usually play it in VLC media player (sudo apt-get install vlc).

$ vlc mydvd.iso
VLC media player

VLC media player

There are lots of programs available to burn the image on DVD media. Probably one is already installed on your computer. If not, you can try Brasero (sudo apt-get install brasero):

Brasero

Brasero

Installing net-snmp MIBs on Ubuntu and Debian

Simple Network Management Protocol (SNMP) is an Internet-standard protocol for managing devices on IP networks. net-snmp is the main SNMP implementation for Linux and BSD platforms. On Ubuntu or Debian net-snmp tools are installed as follows:

$ sudo apt-get install snmp

You can also install snmpd package. This package contains the SNMP agent.

Installing MIBs

For licensing reasons, net-snmp package installs only a small number of MIBs in /usr/share/mibs directory. A large number of standard MIBs can be installed using snmp-mibs-downloader package:

$ sudo apt-get install snmp-mibs-downloader
$ sudo download-mibs

To have the new MIBs recognized by net-snmp, edit /etc/snmp/snmp.conf file as follows:

$ cat /etc/snmp/snmp.conf
mibs +ALL
$

You can use snmptranslate to check the MIBs have been properly installed by printing the MIB tree:

$ snmptranslate -Tp
+--iso(1)
   |
   +--org(3)
      |
      +--dod(6)
         |
         +--internet(1)
            |
            +--directory(1)
            |
            +--mgmt(2)
            |  |
            |  +--mib-2(1)
            |     |
            |     +--system(1)
            |     |  |
            |     |  +-- -R-- String    sysDescr(1)
            |     |  |        Textual Convention: DisplayString
            |     |  |        Size: 0..255
...

Adding additional MIBs

To install additional MIBs you would need to create first a local ~/.snmp/mibs directory:

$ cd ~
$ mkdir -p .snmp/mibs

Drop any additional MIB files you might have in this directory. To install CISCO MIBs, download v2.tar.gz file from ftp://ftp.cisco.com (the file is located in pub/mibs/v2/). Move all the *.my files in the archive in ~/.snmp/mibs directory.

Ubuntu Desktop Memory Comparison

A new Ubuntu release is out, 13.04. As usual it comes in a number of different flavors, covering a wide range of hardware platforms. I am particularly interested in the favors available because my computer is a 6 years old dual-core AMD 64bit with 1GB of memory.

As the Internet stopped getting faster, two years ago I’ve decided not to upgrade it. I don’t “read” flash heavy sites, I guess nobody likes them anyway. For games, movies, and music what I have is more than enough. I do need to keep an eye on memory however. Lately, some developers started to throw into their software everything but the kitchen sink.

Unity

The main Ubuntu desktop environment is Unity. It is a great desktop for new users who aren’t especially computer savvy, and it requires lots of memory to run. As measured using free command after boot up, Unity runs in 437MB and it is visibly slow – definitely not a good choice for an old Widows XP computer!

KDE

With Unity out of the game, I am moving to KDE. It is packaged as an Ubuntu branch under the name Kubuntu. A download image is available for installation, or you can install it using apt-get on an existing Ubuntu computer:

sudo apt-get install kubuntu-desktop

Nice, elegant, and slow, it starts in 435MB of memory.

Ubuntu 13.04 KDE

Ubuntu 13.04 KDE

Gnome

Gnome joined the Ubuntu family earlier this year under the name Ubuntu GNOME. You can find more information here. I have installed it as follows:

sudo apt-get install ubuntu-gnome-desktop ubuntu-gnome-default-settings

It loads in 304MB of memory and it runs fine even on my old machine. It is not a traditional desktop, it doesn’t have a taskbar and a menu. For this reason many people don’t like it. As for me, it is time to move to a series of desktop environments generally characterized as lightweight.

Ubuntu 13.04 Gnome

Ubuntu 13.04 Gnome

Razor-qt

Razor-qt is described as “an advanced, easy-to-use, and fast desktop environment based on Qt technologies. It has been tailored for users who value simplicity, speed, and an intuitive interface. Unlike most desktop environments, Razor-qt also works fine with weak machines.” On my computer it runs very well in 288MB of memory.

Razor-qt is not in this moment an official Ubuntu branch. It is however fully supported, all you have to do is

sudo apt-get install razorqt
Razor-qt Desktop

Razor-qt Desktop

Xfce

Xfce desktop environment has been packaged as an Ubuntu flavor since 2006 under the name Xubuntu. It is low on resources and fast. On my computer it loads in 281MB. I have installed it as:

sudo apt-get install xubuntu-desktop

It is an excellent choice for an old computer. Arguably, most people going linghtweigth end up with Xfce.

Ubuntu 13.04 XFCE

Ubuntu 13.04 XFCE

LXDE

Another popular lightweight Ubuntu flavor is Lubuntu. It uses even less memory than Xubuntu, in my case 184MB. The desktop environment is LXDE. This is what I usually run on my computers.

sudo apt-get install lubuntu-desktop
Ubuntu 13.04 LXDE

Ubuntu 13.04 LXDE

Enlightenment

Enlightenment is a lean, fast, modular and very extensible desktop environment for X11 and Linux. It is classed as a “desktop shell” providing the things you need to operate your desktop or laptop. On my computer it runs in 182MB of memory, very close to LXDE.

It is not an official Ubuntu flavor yet. Fully supported in Ubuntu 13.04, this is how you can install the latest version (E17):

sudo apt-get install e17
E17 Desktop

E17 Desktop

MATE and Cinnamon

MATE is supported in Ubuntu 13.04, and it runs in 264MB of memory. It is installed from developer’s repository as follows:

sudo add-apt-repository "deb http://packages.mate-desktop.org/repo/ubuntu raring main"
sudo add-apt-repository "deb http://repo.mate-desktop.org/ubuntu raring main"
sudo add-apt-repository "deb http://mirror1.mate-desktop.org/ubuntu raring main"
sudo apt-get update
sudo apt-get install mate-archive-keyring
sudo apt-get update
sudo apt-get install mate-core

Starting with Ubuntu 13.04 release, Cinnamon is supported officially in Ubuntu repositories. It runs in 390MB. It is installed as follows:

sudo apt-get install cinnamon

Conclusion

Choice is the best Linux feature ever. Regardless of your circumstances, you can always find a Linux OS to fit that computer of yours. In this case I am looking at Ubuntu 13.04 and its flavors. Stable, mature, and free, Ubuntu is supported by a reputable software company and one of the best user and developer communities.

I have measured the memory using free command in a X terminal after boot up. The number includes everything running on the computer in that specific moment. This is the memory chart:

Ubuntu 13.04 Memory (MB)

Ubuntu 13.04 Memory (MB)


Related Posts

Ubuntu Cleanup

Lightweight Debian: LXDE Desktop From Scratch

In my neck of the woods the Internet doesn’t get any faster, and my six year old dual-core AMD computer still holds up nicely. I don’t like Gnome 3 and I don’t care about Ubuntu’s run everywhere there is lots of memory vision. Linux is all about choice, and I do have plenty of them.

In this article I’ll take a look at Debian. Debian is one of the oldest distributions still in active development. It is a popular distribution for personal use among software developers, it is also the most popular Linux web server platform. Debian has a great community and the amount of software packaged far exceeds any other Linux disto out there.

As usual I’ll keep an eye on memory. I’ll start with a basic server install, I’ll add X Window followed by LXDE desktop environment. What I am after is a picture like this:

openSUSE 12.3 Desktops Memory (MB)

openSUSE 12.3 Desktops Memory (MB)

Installation

Debian has a number of different branches you can chose from. Unstable has the latest and greatest software. The name is somehow unfortunate, I would say the software is more stable than what you can find in Fedora. Stable contains the latest officially released distribution of Debian. This is the production release. Testing branch contains packages that are in the queue to be accepted in the stable branch.

The testing branch (“wheezy”) is supposed to be released in the next few weeks. (Update 5/5/2013: Debian 7.0 “Wheezy” has just been released.) I will install it starting with a network install. The download page is here. I burn the iso image on a USB stick using dd command, but first I need to find out what device driver is handling it using hwinfo.

# hwinfo --disk --short
disk:                                                           
  /dev/sda             HDT722525DLAT80
  /dev/sdb             WDC WD800JB-00FM
  /dev/sdc             Generic USB SD Reader
  /dev/sdd             Generic USB CF Reader
  /dev/sde             Generic USB SM Reader
  /dev/sdf             Generic USB MS Reader
  /dev/sdg             Lexar USB Flash Drive

# dd if=debian-testing-amd64-netinst.iso of=/dev/sdg

The installation was highly uneventful. At some point it offered me the following software choices: Debian desktop environment, Web server, Print server, SQL database, DNS server, File server, Mail server, SSH server, Laptop, and Standard system utilities. I’ve enabled only SSH server and Standard system utilities, and half an hour later I was happily booting my new system.

Server

Logging in, I check ps ax. The command doesn’t show anything unusual started by default:

# ps ax
...
 1850 ?        Ss     0:00 /sbin/rpcbind -w
 1881 ?        Ss     0:00 /sbin/rpc.statd
 1895 ?        Ss     0:00 /usr/sbin/rpc.idmapd
 2160 ?        Sl     0:00 /usr/sbin/rsyslogd -c5
 2210 ?        Ss     0:00 /usr/sbin/atd
 2233 ?        Ss     0:00 /usr/sbin/acpid
 2304 ?        Ss     0:00 /usr/sbin/cron
 2531 ?        Ss     0:00 /usr/sbin/sshd
 2561 ?        Ss     0:00 /usr/sbin/exim4 -bd -q30m
 2588 tty1     Ss     0:00 /bin/login --        
 2589 tty2     Ss+    0:00 /sbin/getty 38400 tty2
 2590 tty3     Ss+    0:00 /sbin/getty 38400 tty3
 2591 tty4     Ss+    0:00 /sbin/getty 38400 tty4
 2592 tty5     Ss+    0:00 /sbin/getty 38400 tty5
 2593 tty6     Ss+    0:00 /sbin/getty 38400 tty6
...

rpc* are the standard NFS tools used for remote access of shared file systems across the network. In many setups the files served by the server are stored in a central location on a different machine. There is also a system logger (rsyslog) and the standard cron daemon. atd daemon allows you to run jobs queued for later execution, and acpid handles the power management of the system. There are 6 consoles handled by getty/login, you can switch between them using Alt-Fn keys. exim4 is your email agent.

As I’ve requested during installation, SSH server is started. By default it allows root login, and it needs some securing.

The server runs in 38MB of memory (I use free command to measure it). It is an excellent base to build a desktop.

X Window

Next step is to install the X Window environment. Debian uses apt-get to manage packages. There are other alternatives available, such as aptitude or synaptic. For now I will stick with apt-get.

# apt-get install xorg

Once installed, I start X Window environment with startx command. In an xterm I use free command to measure the memory: 55MB. Next step is to install LXDE.

LXDE

The command to install LXDE is as follows:

# apt-get install lxde

Unlike openSUSE, installing LXDE will modify the boot lever. Next reboot you will be directed to login into a display manager (lightdm). The desktop runs in this moment into 95MB of memory, slightly lower than openSUSE 12.3.

Debian wheezy LXDE desktop

Debian wheezy LXDE desktop

Installing Programs

Debian has over 30,000 packages to chose form. To search for packages use apt-cache search name command. Once a suitable package is located you can find more about it using apt-cache show package_name. Installing the package is done with sudo apt-get install package_name.

You will probably start with a web browser and mail client. In Debian the regular Mozilla programs are called Iceweasel and Icedove:

# sudo apt-get install iceweasel icedove

You can continue with some text editors, graphic editors, and LibreOffice suite:

# sudo apt-get install vim emacs gedit
# sudo apt-get install gimp inkscape
# sudo apt-get install libreoffice

Debian packages also lots of games.

For sound you can use either alsa or pulseaudio. My personal preference is pulseaudio since this is what vlc supports.

# sudo apt-get vlc libavcodec-extra-53
# sudo apt-get install pulseaudio paprefs pulseaudio-module-jack \
pavucontrol paman alsa-tools-gui
# sudo usermod -a -G pulse,pulse-access `whoami`

Reboot the computer for pulseaudio to kick in. It will add about 10MB to your memory footprint. And yes, it does have mp3 support.

Conclusion

While Debian isn’t exactly the friendliest distribution ever, it’s definitely the best choice to build a lightweight Linux desktop. It is a popular distribution with lots of support behind it, running today a great number of web servers and cloud machines. You might find it worth looking at running on your own system. And if something goes wrong during setup, you can always ask a question on the mailing list, or revert to a distro you know better.

To put things into perspective, I’ve also installed Debian Gnome 3 on this machines. Debian “wheezy” packages Gnome version 3.4. To my surprise, it loaded in 215MB of memory! Under Debian even Gnome 3 looks lean and mean as long as you don’t compare it with LXDE. A better comparison would be Ubuntu 13.4 Unity loading in 425MB or Fedora 18 LXDE spin loading in 220MB.

Here are the numbers:

Debian “wheezy” Memory (MB)

Debian “wheezy” Memory (MB)


Related Posts

A Memory Comparison of Light Linux Desktops – Part 1

A Memory Comparison of Light Linux Desktops – Part 2

Lightweight openSUSE: LXDE Desktop From Scratch

Lightweight openSUSE: LXDE Desktop From Scratch

openSUSE is a great distribution with a great community. It is well known for its excellent Gnome and KDE support. As such, it is never described as a lightweight distribution.

In the latest versions, openSUSE installation media started to offer support for lighter desktop environments, such as LXDE and XFCE. These environments have almost the same application selection as the Gnome version, under a much lighter memory footprint.

If you are looking for a lightweight distro, this is not the time to give up on openSUSE, especially if this is your favorite OS. Try the LXDE/XFCE environments, as lightness goes they are definitely in the same league with Lubuntu/Xubuntu and Fedora LXDE/XFCE Spins. You can do even better, if you build your own desktop starting from a regular server install and adding only the necessary desktop components.

In this article I will describe how to build a light LXDE desktop on the latest openSUSE 12.3 release. I will start with a server install, and I will go trough the process of adding an X Window server and LXDE desktop environment. It is not difficult, and at the very least, it is an opportunity to learn more about a Linux system.

The same way can be done with any other window manager. The result will be different, as each WM/DE has its own memory footprint.

Installation

I installed openSUSE on an old dual-core 64bit computer using the newtork install image. The network was detected automatically, and the install image gave me the following desktop choices: Gnome, KDE, XFCE, LXDE, Minimal X Window, and Minimal Server. I’ve selected Minimal Server and about half an hour later I was happily booting my new system.

Console Mode

First things first, I logged in with the user name/password created during installation and run free command. This told me the system is running in only 41MB of memory. It is definitely a server setup. Once X Window system and LXDE are started, the memory count will go up.

By default, networking subsystem is configured for Dynamic Host Configuration Protocol (DHCP). openSUSE uses dhcpcd daemon to retrieve the configuration from a DHCP server. This setup is probably the most common network setup deployed today, used as default by any operating system out there. If something goes wrong during boot and the DHCP exchange fails, you can restart it manually using rcnetwork restart command.

openSUSE also starts by default a Network Time Protocol (NTP) client. The client daemon keeps the computer time synchronized with a number of reference servers available on Internet.

Also started by default is systemd. This is a system and service manager for Linux, a replacement for the more traditional SysV and Linux Standard Base (LSB) init scripts. It provides very aggressive parallelization capabilities, as a result the system startup is fast.

systemd is still under heavy development and it is not as mature as the other options available. This is one of the main reasons some people are moving away from systemd-based distros such as openSUSE and Fedora to more traditional systems such as Debian.

Another process started by default is D-Bus. It is a message bus system, and it allows desktop applications to talk to one another. It is not clear why openSUSE would chose to run it by default in a server setup.

X Window

Next step is to install the X Window environment. openSUSE uses zypper to manage packages. It is very similar to yum and apt-get, the minor differences can be solved using the man page or –help program argument. To install X11, the command is:

# zypper install xorg-x11 xorg-x11-server

X11 is started using startx command. First time you run it, it will autodetect your hardware and it will autoconfigure your display. The autodetection is usually very good, in my case it detected my display and set it up for 1280×1024 at 60Hz – on a full LXDE desktop you can change it form System/Preferences/Monitor Settings.

Started as root with startx, the X server will complain about a missing window manager. The window manager is a separate component, its job is to open, close, move, minimize, and maximize windows. As I don’t have any window manager installed in this moment, the X server will clear my screen and it will open an xterm. From this xterm it is possible to open more windows and start programs directly from the command line (xterm, firefox, gimp etc.). However, window operations are not implemented, you are always stuck in the last window opened.

Time for a new memory measurement: 61MB reported by free command running in xterm under startx. Press Ctrl-Alt-Backspace to shut it down and return to console mode.

LXDE

Very little information can be found regarding installing LXDE on openSUSE. The best I can came up with is this blog article. I reproduce here the command without NetworkManager, as my network is already doing fine, thanks.

# zypper install lxappearance lxappearance-lang lxappearance-obconf \
lxcc lxde-common lxde-common-branding-openSUSE lxdm lxinput lxmenu-data \
lxmusic lxmusic-lang lxpanel lxpanel-lang lxrandr \
lxsession lxsession-edit lxshortcut lxtask lxterminal \
lxterminal-lang menu-cache mtpaint nuoveXT2-icon-theme \
obconf openal-soft openbox pcmanfm pcmanfm-lang

I create a file .xinitrc in root home directory as follows:

# echo "exec startlxde" > ~/.xinitrc

This file tells X Window server to start LXDE window manager once the xserver is running.

openSUSE 12.3 LXDE Desktop

openSUSE 12.3 LXDE Desktop

(more screenshots here)

Another way to start LXDE is to use a display manager such as xdm. It is started as root with xdm command. It will ask for a user name and password before starting LXDE environment.

In my LXDE terminal free command reports 103MB memory already in use. This is about half the RAM memory compared with major LXDE desktops such as Lubuntu and Fedora LXDE spin. It will also beat openSUSE default LXDE install by a wide margin.

Conclusion

openSUSE is not perceived as a lightweight distro, but you can still build a lightweight system using the regular server install and zypper package manager. And if anything goes wrong, you can revert to the default LXDE system provided in the installation phase. The magic command to install the default LXDE desktop is

# zypper install patterns-openSUSE-lxde

Just to put things into perspective, a full openSUSE 12.3 KDE install on the same computer starts in 344MB.

openSUSE 12.3 Desktops Memory (MB)

openSUSE 12.3 Memory (MB)

Related Posts

A Memory Comparison of Light Linux Desktops – Part 1

A Memory Comparison of Light Linux Desktops – Part 2

Window Mangers/Desktop Environment Blog Clicks

I think it would be interesting to share with you the click-trough stats for my WM/DE memory articles, as reported by wordpress.com. This is not a poll by any stretch of the imagination.

dwm.suckless.org 990
enlightenment.org 861
joewing.net/projects/jwm/ 346
awesome.naquadah.org 268
i3wm.org 250
lxde.org 201
blackboxwm.sourceforge.net 194
icewm.org 183
openbox.org 150
fluxbox.org 143
trinitydesktop.org 91
all-day-breakfast.com/wm2/ 84
xfce.org 77
razor-qt.org 76
xmonad.org 68
mate-desktop.org 53
kde.org 36
cinnamon.linuxmint.com 36
windowmaker.org 30
unity.ubuntu.com 17
fvwm.org 17
gnome.org/gnome-3/ 9
afterstep.org 5

Last update: May 21, 2013

Network and Filesystem Isolation with LXC and virtenv

For my memory comparison of light Linux desktops I needed a tool that would allow me to install on my computer about 20 window managers/desktop environments. After looking at several common virtualization packages, I ended up using Linux containers and virtenv for the job.

LXC and virtenv

Probably the best way to describe virtenv is as a graphic interface for Linux containers utilities developed and distributed by LXC project. Linux containers is the virtualization technology build into Linux kernel, available in any kernel after 2.6.32. LXC is still under heavy development, with lots of new features emerging in 3.x Linux kernel series.

The virtual machines (VM) are driven without any overhead by the kernel already running on the computer. You don’t need to run a different kernel in the virtual machine, run only the processes you need, without even going trough the regular SysV or Linux init. This all means that memory is used very conservatively.

For example, on a 1GB RAM computer you can run easily 10 SSH/DHCP servers, or 10 different xorg/X11 servers with LXDE window managers on top.

virtenv program is build using Qt4, and it is very simple to use. Download it as source code and compile it, or downlaod a .deb file for Ubuntu and install it as

$ sudo apt-get install xserver-xephyr bridge-utils lxc jwm
$ sudo dpkg -i virtrenv_0.8_1.deb

Once installed, you would start it from command line as virtenv, or from System Tools menu.

Filesystem isolation

virtenv mounts copy-on-write the current filesystem installed on the host computer. By default /home directory is not imported in the container. Any modification to the filesystem in the container will stay in the container, the host filesystem remains untouched.

This feature is useful to isolate potentially malicious processes from the host system, install (apt-get) and try new software packages, chroot system for running servers etc.

Network isolation

In my memory comparison exercise, virtenv provided me with filesystem and xorg/X11 server isolation. All this was based on LXC facilities in the existing Linux kernel. LXC has also support for networking stack isolation. I will describe in the rest of the article a setup with one virtual machine connected by an isolated network (br0) to the host computer.

netiso

First thing first, we need to create and configure br0 bridge device:

$ sudo brctl addbr br0
$ sudo ifconfig br0 10.0.0.1/24
$ ifconfig br0
br0       Link encap:Ethernet  HWaddr fa:cc:c0:01:44:a2  
          inet addr:10.0.0.1  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::f8cc:c0ff:fe01:44a2/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:238 (238.0 B)

Then, I start virtenv and create a new virtual machine vm1.

Creating a new virtual machine

Creating a new virtual machine


I configure it for no graphic xserver support, bridge networking and I assign it an IP address of 10.0.0.10/24.

Configuring the virtual machine

Configuring the virtual machine

Once configured, the virtual machine is started automatically by virtenv. The VM has its own xterm acting as a console. I can now ping from this virtual machine the host interface at 10.0.0.1.

Virtual machine console

Virtual machine console

This is all that is to it, nothing more! This kind of network isolation is very useful for software development, testing, trying out new software etc. You can even stream youtube videos in a such a virtual machine with xserver support enabled.

Conclusion

I find it funny how cloud providers sell virtual machines using VM RAM size for pricing. For them, more memory means more money. Such a virtual machine has its own kernel, a full Linux support system (cron, logger etc.) and all the necessary init routines. 512MB or 1024MB is something usual for a VM.

LXC is approaching the same problem from a different angle. There is only one kernel running the host and also the virtual machines. You can build really small virtual machines this way. Some people are also calling them application containers:

Virtual machine RAM Memory
ISC DHCP server, OpenSSH server, rsyslogd 20MB
Apache2 server, OpenSSH server, rsyslogd 22MB
xserver, LXDE window manager 44MB
xserver, KDE Plasma desktop environment 209MB