View on GitHub


Run Linux programs on macOS, a different Linux distro, or a different architecture

Why was Karton created?

At work I use Linux, while my personal computer is a Mac. I want to be able to work from home without having to always take my work laptop back home.

I also didn't want to put up with the limitations of using a virtual machine.
Using Docker was clearly the best solution, but, being designed for something else, didn't provide the usability I wanted.
See the next two questions for details.

Moreover, with Karton, I can also easily compile and run ARM executables on x86-64 without even noticing they are not native.

Why not a virtual machine?

Because I want the most transparent user experience possible. I don't want to notice I'm using a different operating system and I want to use the native tools of the platform I'm using.

Why not use Docker directly?

Docker was created to do something different. According to Docker's web site:

Docker containers wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server. This guarantees that it will always run the same, regardless of the environment it is running in.

I wanted something which is more similar to using a virtual machine, but more transparent to the user.
Karton takes care of lots of small details to make this possible and gives the user what I think is the best experience possible.

Why not a chroot or schroot?

  • Chroots don't work on macOS.
  • Chroots offer only file system-level isolation while containers offer complete logical isolation from a container to the host and all other containers.
  • Docker containers are easier to deal with.
  • Docker containers have their own IP address, hostname, etc.

What about different architectures?

Karton supports x86-64 plus ARM (ARMv7 and ARMv8 aarch64) with the help of Docker and QEMU. This can be set through the props.architecture property in a definition file.

Note that not all distros are supported. At the moment, I believe that only Ubuntu and Debian work reliably.

Does Karton run on Windows?

Not at the moment. I don't use Windows and I cannot port Karton to it. I'm happy to accept contributions to make Karton work on Windows if anybody is interested.

Does Karton run on my Linux distro?

Probably yes, as long as Docker supports it and you are using a recent version of Docker.
At the moment, Karton is tested automatically on Ubuntu, Debian, Fedora and CentOS.

Can I run graphical applications?

Not at the moment, but I'm planning to support X in the future. I don't think it's possible to support Wayland.

Can I use Karton for security reasons or to isolate programs?

You shouldn't.

  • Docker doesn't offer as much security as using virtual machines.
  • Karton was not created with this use case in mind so it's possible it contains bugs that could affect the security aspect of things.
  • Karton uses Docker in privileged mode, which gives containers access to “unsafe” features (this is required, for instance, to allow debuggers to work inside Karton).

What's the license of Karton?

LGPL version 2.1 or later.

In short, this means that you can use Karton freely and modify it, but, if you do any modification, you need to redistribute those under the same license.

If you find this license a limitation for any reason, feel free to contact me. I may be happy to relicense under an MIT-style license if there's a valid use case for it.

Who are you? How can I contact you?

See the footer at the end of this page for my details.

Can I help?

Yes please!

Read the contribute page for details.