---
title: Using LXD with a file-based ZFS pool on Ubuntu Wily
description: Ubuntu 15.10 (Wily) comes natively with some technology previously only
  available in PPAs. LXD is a container hypervisor that enables and facilitates extensive
  and powerful management of LXC containers. It’s great for dense deployments, development
  environments, and specifically workloads that need to be as performant as possible…
  ones wh […]
url: https://canonical.com/blog/using-lxd-with-a-file-based-zfs-pool-on-ubuntu-wily?format=md
---

1. [Blog](https://canonical.com/blog)
2. Article

---

[Dean Henrichsmeyer](https://canonical.com/blog/author/dhenrich "More about Dean Henrichsmeyer")

6 November 2015

# Using LXD with a file-based ZFS pool on Ubuntu Wily

[LXD](https://canonical.com/blog/tag/lxd)
[Wily Werewolf](https://canonical.com/blog/tag/wily-werewolf)
[zfs](https://canonical.com/blog/tag/zfs)

---

Share the article

Ubuntu 15.10 (Wily) comes natively with some technology previously only available in PPAs. LXD is a container hypervisor that enables and facilitates extensive and powerful management of LXC containers. It’s great for dense deployments, development environments, and specifically workloads that need to be as performant as possible… ones where you don’t want the overhead of heavy virtualization.

At any rate, I wanted to play with both ZFS and LXD on my laptop that has only one disk so I thought I’d share the quick set of instructions I used. Thanks to the LXD team at Canonical for their pointers.

First, install the ZFS utilities

```
sudo apt install zfsutils-linux
```

If the ZFS module isn’t loaded automatically, you can load it with:

```
sudo modprobe zfs
```

Then create a file that you’ll use to back the zpool. It’s important to note here that if you use eCryptfs (FDE is your friend), you can’t use sparse files (enjoy your encrypted zeros) so this will take a long time. Anyway, to create a sparse file that can grow to 100GB, use something like:

```
truncate -s 100G filename.img
```

Then you create a zpool using that file with:

```
sudo zpool create nameofzpool /absolute/path/to/filename.img
```

When you’re finished you should be able to type ‘sudo zpool list’ and see something like

```
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
pool 99.5G 2.83G 96.7G - 1% 2% 1.00x ONLINE -
```

Next you need to tell LXD to use that for its storage. You do that with:

```
lxc config set storage.zfs_pool_name nameofzpool
```

As of right now, those zpools are not automatically added at boot so you’ll want to place something like the example below in rc.local or your initialization location of choice. The path should be to the location of where you stored the filename.img.

```
zpool import -d /path/to/directory/ -a
```

Ideally you would have a separate device to create your zpool on. In the absence of that, at least you can exercise LXD and ZFS on a single disk to see how things work. Enjoy the speed and power of LXD.

## Sign up for our newsletter

Get the latest Canonical news and updates in your inbox.

Work email:

\*I agree to receive information about Canonical's
products and services.

By submitting this form, I confirm that I have read and agree to [Canonical's Privacy Policy](https://canonical.com/legal/dataprivacy).

Sign up

## Share on

---

## Related posts

[### Ubuntu Server: a platform made for enterprise scale](https://canonical.com/blog/ubuntu-server-a-platform-made-for-enterprise-scale)

A platform is an environment that allows software to run smoothly across the infrastructure, runtime, and application layers. The key word there is “smoothly”: a good platform...

[Rhys Knipe](https://canonical.com/blog/author/rhysknipe)

7 July 2026

[### Introducing MicroCloud Cluster Manager](https://canonical.com/blog/introducing-microcloud-cluster-manager)

Canonical introduces the beta release of MicroCloud Cluster Manager, a new way to discover, organize, and operate your MicroCloud environments from a single, unified interface.

[Miona Aleksic](https://canonical.com/blog/author/mionaalex)

20 March 2026

[### Native integration available between Canonical LXD and HPE Alletra MP B10000](https://canonical.com/blog/canonical_lxd_hpe_alletra)

Native integration available between Canonical LXD and HPE Alletra MP B10000. The integration combines efficient open source virtualization with high performance,...

[Miona Aleksic](https://canonical.com/blog/author/mionaalex)

15 December 2025

[### Generating allow-lists with DNS monitoring on LXD](https://canonical.com/blog/generating-allow-lists-with-dns-monitoring-on-lxd)

Allow-listing web traffic – blocking all web traffic that has not been pre-approved – is a common practice in highly sensitive environments. It is also a challenge for...

[Nicholas Morris](https://canonical.com/blog/author/niwamo)

26 August 2025
