Add new comment

OpenSuSE LXC container inside Ubuntu

Submitted by lennart on Thu, 06/30/2011 - 23:56

Because I didn't get iFolder to run on Ubuntu directly, I installed an OpenSuSE LXC container and installed iFolder in that one.

This howto describes how to install OpenSuSE 11.3 inside an LXC container on an Ubuntu Natty Server. At the time of writing, OpenSuSE 11.4 is available, but iFolder isn't stable on it yet.

Basic *nix knowledge is assumed, I'm not going to tell you how to open vi (or whatever editor you prefer).

Install LXC

If LXC is not installed and configured yet, please see my previous tutorial. Just don't create the natty container then ;-)

Add OpenSuSE template to Ubuntu.

I've created a template script for this: lxc-opensuse_11.3 or lxc-opensuse_11.4

Download it and place it in /usr/lib/lxc/templates/lxc-opensuse_11.3

FYI, what this template script will do:

Install container

Now that we have an OpenSuSE container template, installing the OpenSuSE container itself is as easy as installing any other container.

Create a configuration file for your container (e.g. suse.conf), with the following content:

lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br-lxc
lxc.network.ipv4 = 192.168.254.3/24

This assumes your bridge container is named br-lxc (which is what I use in my LXC tutorial).

And create the container:

lxc-create -n <container-name> -t opensuse_11.3 -f suse.conf

Run the container

screen -dmS init-<container-name> lxc-start -n <container-name> 

You can ssh or connect to the screen. The default password for root is root.

Add software repositories

This SuSE container will not have any software repositories set. You can easily add them through YaST.

Run yast, and go to Software -> Software Repositories. You can see a list of available software repositories at http://en.opensuse.org/Package_repositories.

I added the following specific URL's:

Et voila, ready to go!

One last thing that might be useful when switching from Ubuntu to SuSE:

Ubuntu SuSE
Install package from repository: apt-get install <package> zypper install <package>
Install package from file dpkg -i <file> rpm -i <file>
Remove package apt-get remove <package> zypper remove <package>
Update package apt-get install <package> zypper update -t package <package>
Update package list apt-get update zypper refresh
Update system apt-get upgrade zypper update
Search package name apt-cache search <package> zypper search <package>
Search package pattern apt-cache search <package> zypper search -t pattern <pattern>
Search file name apt-cache search <file> zypper wp <file>
List installed packages dpkg -l zypper search -is
List repositories cat /etc/apt/sources.list zypper repos
Add repository add-apt-repository ppa:<repository> zypper addrepo <repository>
Remove repository edit /etc/apt/sources.list and update package list zypper removerepo <repository>

And SuSE comes with the configuration tool called YaST (yast), wich has an ncurses user interface.



Credits:

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.