How can I separate my work-developer environment and home-user environment effectively?

1

I used python-virtualenv previously for python tools, but now I've found a new remote job which needs a lot of native tools to be installed into my system. The question is how can I separate my work-developer environment and home-user environment?

For example I need to install opencv which needs a lot of environment changes but I don't want to keep these changes in my system all the time, I want to set it (and all the software I need for my remote work) in another environment and use it there when I need. The first thing that is coming to my mind is simple using of chroot. But maybe some cool practices exists which I don't know?

I did not use chroot a lot that's why I am asking.

Victor Polevoy

Posted 2014-10-10T11:06:25.880

Reputation: 142

Answers

2

I would suggest any of the following tools;

Docker

or

LXC

I am still learning Docker as I have discovered it recently, but it doesn't take one long to realize that Docker is tool built for developers. Give it spin and enjoy! And note that Docker rocks when it comes to configuring things via Environment Variables.

I have used LXC tools for while and they are pretty okay but, for development they require a lot of setup work. And chroots require even more work too, to me they take away from you development focus. And they are not very portable.

Also you might want to take a look at Vagrant.

Can't post a lot links here since I'm new but Vagrant is so popular if you type it in a google search it will be the first or second result you see.

"Create and configure lightweight, reproducible, and portable development environments."

Also note that Vagrant works with various Virtual Machine or Container Environments. Think of it as a tool to create your virtual development environment with one command "vagrant up". And it's not limited to Linux, it works (exactly the same!) on Linux, Mac OS and Windows.

Not to mention when you docker and/or vagrant you can check your Dockerfile or Vagrantfile into your version control system. So they become part of your project and change with your project.

Hope these tools help.

Matthew O'N.S Jordan

Posted 2014-10-10T11:06:25.880

Reputation: 36

2

Docker may work for you but that isn't the best tool for the job.

I would strongly suggest you look at Vagrant. It will do exactly what you I believe and it much easier to deal with.

In a nutshell you have your desktop and then you install virtualbox and vagrant.

Possible workkflow:

  1. Download a prebuilt box that match as close as possible to your needs
  2. Startup vagrant using this box
  3. SSH into the virtual machine(box)
  4. Do your thing
  5. Stop the machine when done.

Some of the advantages to this are you can add a script that will automatically run when you start vagrant, this can configure your environment how you choose and make sure it is always identical every time, Chef/Puppet/Ansible/? can be used as well to great effect.

If you don't feel like keeping a lot of virtual machines around, you have the ability to delete them and then when you need them again you could just download the box again and run the script.

Another good point about this when developing is that if something goes haywire, you can just shutdown the system and bring it back up again and it will be clean and fresh. Shared folders are automatically configured as well so you can drop anything you want into the root vagrant directory on the host and it will be located in /vagrant on the virtual machine.

If you use a tool called packer, you can build the vagrant box and also other types as well including OVF, Digital Ocean, and AWS. Racker is a great addition to packer as well. At some point you may want to deploy and this will ensure the image that is being deployed will match 100% the image you have been working with, in fact Packer is what vagrant and a lot of other companies use to build vagrant boxes.

http://blog.endpoint.com/2014/03/provisioning-development-environment.html

http://blog.codeship.io/2013/11/07/building-vagrant-machines-with-packer.html

Matty

Posted 2014-10-10T11:06:25.880

Reputation: 314

0

If you use Debian, I'd recommend you to use debootstrap to create chroots. Also, there's a tool called schroot which allows you to create an arbitrary number of chroots, manage permissions and do all sorts of stuff with them. Unfortunately, it's way too advanced for me, so I'm using only debootstrap alone, and sometimes cowbuilder/pbuilder to recreate a clean build environment.

andrewsh

Posted 2014-10-10T11:06:25.880

Reputation: 186