Showing posts with label Citrix. Show all posts
Showing posts with label Citrix. Show all posts

Friday, August 5, 2016

Slackware and LXC

I have a fresh Slackware 14.2 I've been enjoying since it came out this month.  I needed a hyper-visor and was getting ready to add Xen (the hyper-visor of choice on Slackware).  I like Xen, but I knew the compile times for the Slackbuilds and it's dependencies would probably take more time than I had at the moment.  Then I remembered LXC.  It comes with.

I didn't know much about LXC so did some quick reading.  They say "it's similar to Docker but easier" - I like the sound of that.  So I check it out.  It's EXACTLY like Solaris containers!  Which I've been using for over 10 years - but, again, easier!  It's pretty slick!  And it installs by default on Slackware 14.2 but there's a few things you need to change.

ON THE HOST

Edit the /etc/rc.d/rc.inet1.conf

Slackware does not have a bridged network device by default BUT it does have it defined and commented out.  I found this works nicely except I was expecting my host interface to use eth0 and lxc guest to use br0.  It was not what I expected but it works fine!

# Example of how to configure a bridge:
# Note the added "BRNICS" variable which contains a space-separated list
# of the physical network interfaces you want to add to the bridge.
IFNAME[0]="eth0"
BRNICS[0]="br0"
#IPADDR[0]=""
#NETMASK[0]=""
USE_DHCP[0]="yes"
#DHCP_HOSTNAME[0]=""

Routing = Yes

You will, of course, need your host to route packets so

# chmod 755 /etc/rc.d/rc.ip_forward

And then start it or restart.  I like to restart to make sure everything is the way it needs to be before relying on it.  You could also just

# echo 0 > /proc/sys/net/ipv4/ip_forward


LXC Config

Really the only other thing you need to do is add a bit to /etc/lxc/default.conf.  This worked for me:

root@slacks:~# cat /etc/lxc/default.conf
lxc.network.type=veth
lxc.network.link=br0
lxc.network.flags=up

ON THE LXC GUEST

Just run netconfig and set a static address or DHCP and then restart rc.inet1.  

WHAT LXC GUEST?!!

Oh, I skipped that bit, eh?  Super simple.  Try this:
  
# lxc-create -n lxcguest -t /usr/share/lxc/templates/lxc-slackware
# lxc-start -n lxcguest -d
# lxc-console -n lxcguest  (it'll tell you how to login)

Now, run netconfig.  

What?!  You're already running Slackware on the host and you'd like to try something different?  Just run list the contents of  /usr/share/lxc/templates and then try one or a dozen of the other 18 pre-installed templates.  Like:

root@slacks:~# ls /usr/share/lxc/templates
lxc-alpine*     lxc-cirros*    lxc-openmandriva*  lxc-sparclinux*
lxc-altlinux*   lxc-debian*    lxc-opensuse*      lxc-sshd*
lxc-archlinux*  lxc-download*  lxc-oracle*        lxc-ubuntu*
lxc-busybox*    lxc-fedora*    lxc-plamo*         lxc-ubuntu-cloud*
lxc-centos*     lxc-gentoo*    lxc-slackware*



If you down like any of those, try something else with this command:

# lxc-create -t /usr/share/lxc/templates/lxc-download -n newguest

You will be given an even bigger choice.  Knowing Slackware and how stable it is, I would stay with the local choices to ensure that legendary stability stays as is (but that's just me). 


THE END

Well, that's all of my notes.  Postive comments and any kind of experiences with LXC are always welcome below.  

Thursday, December 17, 2015

The Joy of Modern Computing

  1. Solaris Zones & Containers
  2. Oracle VirtualBox
  3. Xen 
  4. VMware
  5. KVM 
  6. Heroku
  7. Hyper-V 
  8. Citrix XenServer 
  9. Oracle VM Manager (OVM) 
  10. Amazon Web Services (AWS) 
  11. Microsoft Azure Cloud Services
These are a few of my favorite virtualization platforms that I've been using since 2006. I love virtualization!  I work mainly out of a virtualized desktop running ssh into virtualized systems.   Lately, I've been working a lot with Microsoft Azure Cloud Services.

It's funny how this is perceived by some people unfamiliar with it.  Today in a meeting, some people thought that moving systems to the "cloud" would cause a loss of IT positions.  I never thought so.  My least favorite part of the job is the part that takes .001% of your time - mounting the physical hardware in a rack and wiring it.  If that goes away, I will not miss it at all.

I love that I can clone, copy and snapshot VMs.  Using physical hardware now seems to me like working without a net. I would not want to go back.  Even better is having the services in the cloud.  No messy wires, no failing hard drives (I have an open ticket for one now).  Even backups are a breeze.

I have a 32 bit Windows 7 desktop VM that I migrated from a PC running CentOS 5 under Xen to a PC running Red Hat Linux 6 running KVM (that was a tough migration - but it worked!) and then I moved it again to a PC running Oracle Linux 7 under KVM (much easier move).  So, my Windows 7 has been with me through 3 PCs.  All of my stuff is there - all my files and software.  Virtualized PC's are really cool!

I also run additional VMs on my PC.  If a new distro comes out and I want to see what it looks like - I just load it from the ISO!  I don't have to have spare hardware.  It's great!  I have been running my desktop like this about 6 years and can't imagine doing it any other way.  (I started virtualizing my servers almost 10 years ago).

Lately, as I have built about a dozen various VMs in Azure.  I've been testing the cloning of VMs & filesystems and securing endpoints. (It took some time to figure out how to reserve static addresses.)

Now, I love Linux and my technology passion is learning pretty much anything OpenSource - BUT, even though I could do quite a bit with the cross platform kit for Azure under Linux - most of the work was easier in Powershell.  No problem - because I really like Powershell - BUT, my 32 bit Windows 7 system didn't seem to want to finish the install and hung twice.  I figured it was because it was 32 bit.  Again, thanks to virtualization - No problem - I just loaded up 64 bit Windows 10.  (I tried to like Windows 8 and 8.1 but eventually gave up. Skipping that one.)  Windows 10 is a nice mix and seems more intuitive then its predecessor and ran the Azure Powershell environment which made cloning much easier.

The cool thing is, I can still run my old Windows 7 for as long as it gets patches (and then I could just remove the network and keep it for nostalgia) BUT I also get to run Windows 10 and use the Azure Powershell features I need.

Anyway, Linux and KVM gives you a lot of possibilities and it's free (your VMs, may not be).