Giter Club home page Giter Club logo

multipass's Introduction

What is Multipass?

Multipass is a lightweight VM manager for Linux, Windows and macOS. It's designed for developers who want a fresh Ubuntu environment with a single command. It uses KVM on Linux, Hyper-V on Windows and QEMU on macOS to run the VM with minimal overhead. It can also use VirtualBox on Windows and macOS. Multipass will fetch images for you and keep them up to date.

Since it supports metadata for cloud-init, you can simulate a small cloud deployment on your laptop or workstation.

Project Status

Service Status
CI Build Status
Snap Build Status
Codecov Codecov Status

Install Multipass

On Linux it's available as a snap:

sudo snap install multipass

For macOS, you can download the installers from GitHub or use Homebrew:

# Note, this may require you to enter your password for some sudo operations during install
# Mac OS users may need to disable their firewall to launch a multipass instance successfully
brew install --cask multipass

On Windows, download the installer from GitHub.

Usage

Find available images

$ multipass find
Image                       Aliases           Version          Description
core                        core16            20200213         Ubuntu Core 16
core18                                        20200210         Ubuntu Core 18
16.04                       xenial            20200721         Ubuntu 16.04 LTS
18.04                       bionic,lts        20200717         Ubuntu 18.04 LTS
20.04                       focal             20200720         Ubuntu 20.04 LTS
daily:20.10                 devel,groovy      20200721         Ubuntu 20.10

Launch a fresh instance of the current Ubuntu LTS

$ multipass launch ubuntu
Launching dancing-chipmunk...
Downloading Ubuntu 18.04 LTS..........
Launched: dancing chipmunk

Check out the running instances

$ multipass list
Name                    State             IPv4             Release
dancing-chipmunk        RUNNING           10.125.174.247   Ubuntu 18.04 LTS
live-naiad              RUNNING           10.125.174.243   Ubuntu 18.04 LTS
snapcraft-asciinema     STOPPED           --               Ubuntu Snapcraft builder for Core 18

Learn more about the VM instance you just launched

$ multipass info dancing-chipmunk
Name:           dancing-chipmunk
State:          RUNNING
IPv4:           10.125.174.247
Release:        Ubuntu 18.04.1 LTS
Image hash:     19e9853d8267 (Ubuntu 18.04 LTS)
CPU(s):         1
Load:           0.97 0.30 0.10
Disk usage:     1.1G out of 4.7G
Memory usage:   85.1M out of 985.4M

Connect to a running instance

$ multipass shell dancing-chipmunk
Welcome to Ubuntu 18.04.1 LTS (GNU/Linux 4.15.0-42-generic x86_64)

...

Don't forget to logout (or Ctrl-D) or you may find yourself heading all the way down the Inception levels... ;)

Run commands inside an instance from outside

$ multipass exec dancing-chipmunk -- lsb_release -a
No LSB modules are available.
Distributor ID:  Ubuntu
Description:     Ubuntu 18.04.1 LTS
Release:         18.04
Codename:        bionic

Stop an instance to save resources

$ multipass stop dancing-chipmunk

Delete the instance

$ multipass delete dancing-chipmunk

It will now show up as deleted:

Name                    State             IPv4             Release
snapcraft-asciinema     STOPPED           --               Ubuntu Snapcraft builder for Core 18
dancing-chipmunk        DELETED           --               Not Available

And when you want to completely get rid of it:

$ multipass purge

Get help


multipass help
multipass help <command>

Get involved!

Here's a set of steps to build and run your own build of Multipass. Please note that the following instructions are for building Multipass for Linux only. These instructions do not support building packages for macOS or Windows systems.

Build Dependencies

cd <multipass>
apt install devscripts equivs
mk-build-deps -s sudo -i

Building

cd <multipass>
git submodule update --init --recursive
mkdir build
cd build
cmake ../
make

Running Multipass daemon and client

First, install multipass's runtime dependencies. On amd64 architecture, you can achieve that with:

sudo apt update
sudo apt install libgl1 libpng16-16 libqt6core6 libqt6gui6 \
    libqt6network6 libqt6widgets6 libxml2 libvirt0 dnsmasq-base \
    dnsmasq-utils qemu-system-x86 qemu-utils libslang2 iproute2 \
    iptables iputils-ping libatm1 libxtables12 xterm

Then run multipass's daemon:

sudo <multipass>/build/bin/multipassd &

Copy the desktop file multipass clients expect to find in your home:

mkdir -p ~/.local/share/multipass/
cp <multipass>/data/multipass.gui.autostart.desktop ~/.local/share/multipass/

Optionally, enable auto-complete in bash:

source <multipass>/completions/bash/multipass

Finally, use multipass's clients:

<multipass>/build/bin/multipass launch --name foo  # CLI client
<multipass>/build/bin/multipass.gui        # GUI client

More information

See the Multipass documentation.

multipass's People

Contributors

alangriffiths avatar albaguirre avatar alexbathome avatar andrei-toterman avatar bors[bot] avatar davidkrauser avatar develar avatar dlbeck avatar georgeliao avatar gerboland avatar ianbtr avatar katie-knister avatar kbdharun avatar luis4a0 avatar maksimdanilov avatar makspiechota avatar markshuttle avatar nielsreijers avatar pcgeek86 avatar pekof avatar petrosargyrakis avatar renovate[bot] avatar ricab avatar rim99 avatar rtgill82 avatar saviq avatar sharder996 avatar surahman avatar tchajed avatar townsend2010 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

multipass's Issues

VMs have the same mac address.

I am running Ubuntu 16.04 with multipass via snapd.
When I launch two VM's they have the same MAC Address:

root@kubslave01:~# ifconfig 
ens3      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:10.122.122.5  Bcast:10.122.122.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2128 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1932 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4312861 (4.3 MB)  TX bytes:257053 (257.0 KB)

root@kubmaster01:~# ifconfig
ens3      Link encap:Ethernet  HWaddr 52:54:00:12:34:56  
          inet addr:10.122.122.4  Bcast:10.122.122.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fe12:3456/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3559 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3371 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4381953 (4.3 MB)  TX bytes:580441 (580.4 KB)

This of course causes issues with multipass connect when connecting to the instances.
My suggestion is to generate and add the macaddr=XX:XX:XX:XX:XX:XX parameter when launching a multipass VM.

Unexpected qemu process exit is not relayed back to the client during launch & start

I wanted to run a new instance on a VPS.

# multipass launch --name=foo
failed to launch: failed to determine IP address

Running qemu by hand gives me this (command copied from ps -flA | grep qemu on another machine where an instance of the same name was running fine):

(qemu) qemu-system-x86_64: cannot set up guest memory 'pc.ram': Cannot allocate memory

Increasing the memory of the system fixed it.

multipass needs to detect when instance rebooted from inside the VM

Similar to #47 but different.
Inside VM I initiated shutdown. Then I remembered I did not unmount a share so I told multipass to unmount. For a while multipass list did not work, looks like it restored after VM was finally down.

# multipass mount remote:no_backup Mate-17-10:pks
... all works at this time, copied files etc, then did shutdown inside VM...
# multipass list
Name State IPv4 Release
Mate-17-10 RUNNING 10.122.122.5 Ubuntu 17.10
podstest STOPPED -- Ubuntu 16.04 LTS
# multipass umount Mate-17-10:pks
# multipass list
list failed: Connect Failed
# multipass list
list failed: Connect Failed
# multipass list
list failed: Connect Failed
# multipass list
list failed: Connect Failed
# multipass list
list failed: Connect Failed
# multipass list
list failed: Connect Failed
# multipass list
Name State IPv4 Release
Mate-17-10 STOPPED -- Ubuntu 17.10
podstest STOPPED -- Ubuntu 16.04 LTS

It was like 15-20 seconds

some actions on mounted directory fail with permission denied

I created a directory on host and mounted it to VM
multipass mount remote:/home/marian/VMs/multipass/git Mate-17-10:git

when I connect to VM, I can create files and directories in mounted dir, but git clone fails

Cloning into 'mate-applets'...
error: could not write config file /home/ubuntu/git/mate-applets/.git/config: Operation not permitted
fatal: could not set 'core.filemode' to 'true'

When I move outside the mounted directory, git clone works.

When I return back to host and run git clone into that directory, it works.

Going back to VM, I can see cloned dir, I start ./autogen.sh. It starts to work, creates things as expected, but then fails with
./autogen.sh: 438: /usr/bin/mate-autogen: ./configure: Permission denied

Maybe exec flag on mount missing?
It is mounted as

:/home/marian/VMs/multipass/git on /home/ubuntu/git type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)

Need to wait for `cloud-init` to complete

If you try to interact with an instance before cloud-init completes, it might fail (say, apt still updating), or even worse we can interrupt some cloud-init steps and leave the instance in a bad state.

feature request: add --all option to info

It would be nice if multipass mount without arguments could show a list of all defined mounts. Plus also show if it is an active mount with running instance or an inactive mount with stopped instance.

`multipass find` output not clear enough

I appreciate we have both breezy and bionic as codenames, so technically there have been two b releases, multipass doesn't seem to know breezy. So why complain about multiple 'b' options?

alan@hal:~$ multipass launch b
failed to launch: Too many images matching "b"                                  
alan@hal:~$ multipass find
multipass launch …   Starts an instance of   Image version
----------------------------------------------------------
14.04                Ubuntu 14.04 LTS        20171208
   (or: t, trusty)
16.04                Ubuntu 16.04 LTS        20171208
   (or: default, lts, x, xenial)
17.04                Ubuntu 17.04            20171208
   (or: z, zesty)
17.10                Ubuntu 17.10            20171213
   (or: a, artful)
daily:18.04          Ubuntu 18.04 LTS        20171213
   (or: b, bionic, devel)

`sshfs` mount options need `allow_other`

When mounting, we should pass allow_other option to the mount command, otherwise only the mounting user (ubuntu) has permissions to the files.

This means that we either run the mount command as root, or need to modify /etc/fuse.conf to allow this when mounting non-root.

cannot git clone to mounted dir

Cloning into mounted dir fails (tried also other repos, same result)

~/git$ git clone https://github.com/CanonicalLtd/multipass.git
Cloning into 'multipass'...
remote: Counting objects: 664, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 664 (delta 9), reused 16 (delta 6), pack-reused 637
Receiving objects: 100% (664/664), 263.22 KiB | 95.00 KiB/s, done.
fatal: premature end of pack file, 68 bytes missing
fatal: index-pack failed

Works ok inside VM outside mounted dir

~$ git clone https://github.com/CanonicalLtd/multipass.git
Cloning into 'multipass'...
remote: Counting objects: 664, done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 664 (delta 9), reused 16 (delta 6), pack-reused 637
Receiving objects: 100% (664/664), 263.22 KiB | 421.00 KiB/s, done.
Resolving deltas: 100% (399/399), done.

latest edge version

tracking:               edge
installed:              2017.2.3-15-g3b0f808 (124) 63MB classic
refreshed:              2018-01-30 17:00:20 +0100 CET
channels:                                          
  stable:               –                               
  candidate:            –                               
  beta:                 2017.2.3             (111) 63MB classic
  edge:                 2017.2.3-15-g3b0f808 (124) 63MB classic

Mount command usage and help is not clear

Some feedback we've received in the public beta is that the mount command usage and help is not very clear and leads to unexpected results and unintended expectations.

For the usage, I suggest <source> just specify a local directory on the host with no mention of remote: or other instance names. And then we can clean up the description for <source> once we drop the optional [<name>:] part.

Reviewing the other arguments in mount, I think they there are pretty clear.

I will also mention that we've had some feedback suggesting that users are trying to mount directories inside the VM onto the host, which we do not support and probably won't support in the future. We should probably find a way to make it clear that this use case is not possible.

strange issue with mount

I cloned a repo from github, without any other actions when I try to checkout my branch it says I have modified files. Plus see how long it took to report the problem. It is also interesting there is that automatic step of checkout 1090 files which does not happen when not in mounted dir.

$ rm -rf mate-applets/
$ ll
total 8
drwxrwxr-x  1 ubuntu ubuntu 4096 Jan 27 13:51 ./
drwxr-xr-x 27 ubuntu ubuntu 4096 Jan 27 13:41 ../
$ git clone https://github.com/marosg42/mate-applets.git 
Cloning into 'mate-applets'...
remote: Counting objects: 7363, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7363 (delta 0), reused 1 (delta 0), pack-reused 7358
Receiving objects: 100% (7363/7363), 20.95 MiB | 137.00 KiB/s, done.
Resolving deltas: 100% (4475/4475), done.
Checking out files: 100% (1090/1090), done.
$ cd mate-applets/
$ git branch 
* master
$ time git checkout multiload-network-scale 
error: Your local changes to the following files would be overwritten by checkout:
	multiload/linux-proc.c
	multiload/load-graph.c
	multiload/main.c
	multiload/org.mate.panel.applet.multiload.gschema.xml.in
	multiload/properties.c
Please commit your changes or stash them before you switch branches.
Aborting

real	0m27.345s
user	0m0.065s
sys	0m0.130s

Funny thing is, I have those files modified in the same repo, in multiload-network-scale branch but in totally different directory in that instance, they are not in remote repo. It looks like it is looking into other dirs or something like that, I cannot explain.

These are exactly the same steps done outside of mounted directory, that checkout step during clone is not happening and all works as expected.


$ rm -rf mate-applets/
$ git clone https://github.com/marosg42/mate-applets.git 
Cloning into 'mate-applets'...
remote: Counting objects: 7363, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 7363 (delta 0), reused 1 (delta 0), pack-reused 7358
Receiving objects: 100% (7363/7363), 20.95 MiB | 130.00 KiB/s, done.
Resolving deltas: 100% (4475/4475), done.
$ cd mate-applets/
$ git branch
* master
$ time git checkout multiload-network-scale 
Branch multiload-network-scale set up to track remote branch multiload-network-scale from origin.
Switched to a new branch 'multiload-network-scale'

real	0m0.081s
user	0m0.070s
sys	0m0.012s

I/O error with mount involving symlinks

> multipass launch --name=foo
> git clone https://github.com/LaughingLove/branch-diff-snap.git
> cd branch-diff-snap
> multipass mount . foo
> pwd
/home/cris/bau/branch-diff-snap
> multipass connect foo
$ cd /home/cris/bau/branch-diff-snap
$ sudo snap install snapcraft --classic --edge
$ $ snapcraft
Installing build dependencies: libc-dev-bin libc6-dev linux-libc-dev manpages-dev zlib1g-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  glibc-doc
The following NEW packages will be installed:
  libc-dev-bin libc6-dev linux-libc-dev manpages-dev zlib1g-dev
0 upgraded, 5 newly installed, 0 to remove and 2 not upgraded.
Need to get 5,188 kB of archives.
After this operation, 22.5 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 libc-dev-bin amd64 2.23-0ubuntu10 [68.7 kB]
[...]
Get:1 liberror-perl_0.17-1.2_all.deb [19.6 kB]                                            
Fetched 19.6 kB in 0s (0 B/s)                                                             
Traceback (most recent call last):
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2205, in makelink
    os.symlink(tarinfo.linkname, targetpath)
OSError: [Errno 5] Input/output error: '6' -> '/home/cris/bau/branch-diff-snap/parts/branch-diff/install/./usr/lib/gcc/x86_64-linux-gnu/6.0.0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/snap/snapcraft/1069/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.38', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/1069/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 565, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/snap/snapcraft/1069/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2631, in load_entry_point
    return ep.load()
  File "/snap/snapcraft/1069/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2291, in load
    return self.resolve()
  File "/snap/snapcraft/1069/usr/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2297, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/cli/__main__.py", line 19, in <module>
    run(prog_name='snapcraft')
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/cli/_runner.py", line 72, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/cli/lifecycle.py", line 139, in snap
    project_options, directory=directory, output=output)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_packer.py", line 45, in snap
    execute('prime', project_options)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 184, in run
    self._run_step(step, part, part_names)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/lifecycle/_runner.py", line 214, in _run_step
    getattr(part, 'prepare_{}'.format(step))()
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 266, in prepare_pull
    self._unpack_stage_packages()
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/pluginhandler/__init__.py", line 260, in _unpack_stage_packages
    self._stage_packages_repo.unpack(self.installdir)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/repo/_deb.py", line 375, in unpack
    unpackdir, src=pkg, clean_target=False, keep_deb=True)
  File "/snap/snapcraft/1069/lib/python3.6/site-packages/snapcraft/internal/sources/_deb.py", line 67, in provision
    tar.extractall(dst)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2003, in extractall
    numeric_owner=numeric_owner)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2045, in extract
    numeric_owner=numeric_owner)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2123, in _extract_member
    self.makelink(tarinfo, targetpath)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2216, in makelink
    targetpath)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2117, in _extract_member
    self.makedir(tarinfo, targetpath)
  File "/snap/snapcraft/1069/usr/lib/python3.6/tarfile.py", line 2146, in makedir
    os.mkdir(targetpath, 0o700)
OSError: [Errno 5] Input/output error: '/home/cris/bau/branch-diff-snap/parts/branch-diff/install/./usr/lib/gcc/x86_64-linux-gnu/6.0.0'

Improve message when KVM is unavailable (conflict with VirtualBox)

alan@hal:~$ multipass launch 
failed to launch: ioctl(KVM_CREATE_VM) failed: 16 Device or resource busy       
failed to initialize KVM: Device or resource busy

This is because I have VirtualBox installed (and running) on this machine. I had to kill the VBox processes to allow multipass to run. Perhaps a nicer error message might be useful here?

multipass bridge subnet may clash

We're using a static private subnet of 10.122.122.0/24 for multipass instances, there's a chance that one's already used (like if you installed multipass inside multipass, even if that's not gonna really work).

We should probably try and randomize, and verify there's not a route for it on the host.

'multipass exec' hangs in some cases (race condition?)

If you try

multipass exec myVM -- uname -a

several times, it hangs (around one out of three times).
You would need to stop, then restart the virtual machine in order to continue.

I managed to get

multipass exec myVM pwd

to hang by trying it about 15 times. Therefore, it does not matter which command it is. But some commands are too prone to hang than others.

Broken wrapping on snap info multipass

The description is incorrectly wrapped when running snap info multipass.

jamie@ubik:~$ snap info multipass
name:      multipass
summary:   Ubuntu at your fingertips
publisher: saviq
description: |
  Multipass gives you Ubuntu VMs in seconds. Just run `multipass.ubuntu create`
  and
  it'll do all the setup for you.
snap-id: mA11087v6dR3IEcQLgICQVjuvhUUBUKM
commands:
  - multipass
services:
  multipass.multipassd: simple, enabled, active
tracking:               edge
installed:              2017.2.1-3-g248ab13 (31) 44MB devmode
refreshed:              2017-12-07 11:45:27 +0000 UTC
channels:                                        
  stable:               –                             
  candidate:            –                             
  beta:                 2017.2.2            (37) 44MB classic
  edge:                 2017.2.2-4-g691449f (38) 44MB classic

-vvv is not the same as -v -v -v

Since --help suggests this

  -v, --verbose  Increase logging verbosity, repeat up to three times for more
                 detail

I did this:

$ multipass start -vvv test
Verbose level: 0

That seemed wrong, so I instead tried this:

$ multipass start -v -v -v foo
Verbose level: 3

I'd expect both of these to have the same effect.

`exec` does not exit on EOF

It's possible to pipe stdin into multipass exec, but EOF there isn't passed through?

This works:

⟫ multipass exec instance tee foo
bar
^D

But this hangs:

⟫ echo bar | multipass exec instance tee foo

copying excutable file to mount directory strips away executable bit

Current directory is in mounted dir. When I copy executable .sh anywhere outside moutned dir, it stays executable as expected


$ ll ~/mate-applets/autogen.sh 
-rwxrwxr-x 1 ubuntu ubuntu 575 Jan 27 14:11 /home/ubuntu/mate-applets/autogen.sh*
$ cp  ~/mate-applets/autogen.sh ~
$ ll ~/autogen.sh 
-rwxrwxr-x 1 ubuntu ubuntu 575 Jan 27 14:28 /home/ubuntu/autogen.sh*

When I copy the same file to mounted directory, it is not executable

$ cp  ~/mate-applets/autogen.sh .
$ ll autogen.sh 
-rw-r--r-- 1 ubuntu ubuntu 575 Jan 27 14:30 autogen.sh

chmod +x works
I observed it first when I ran autogen.sh which generates configure script but in mounted directory it is not generated as executable.

Multipass help shows an unhelpful Usage: command

Usage: multipass [options] <command> would be better.

jamie@ubik:~$ multipass help
Usage: /snap/multipass/31/bin/multipass [options] <command>
Create, control and connect to Ubuntu instances.

This is a command line utility for multipass, a
service that manages Ubuntu instances.

Options:
  -h, --help     Display this help
  -v, --verbose  Increase logging verbosity, repeat up to three times for more
                 detail

Available commands:
  connect  Connect to a running instance
  launch   Create and start an Ubuntu instance
  purge    Purge all deleted instances permanently
  exec     Run a command on an instance
  find     Display available images to create instances from
  help     Display help about a command
  info     Display information about instances
  list     List all available instances
  mount    Mount a local directory in the instance
  recover  Recover deleted instances
  start    Start instances
  stop     Stop running instances
  delete   Delete instances
  umount   Unmount a directory from an instance
  version  Show version details

Very slow performance on mounts

When reading and writing to/from a mounted directory, the performance is just plain awful.

On a fully optimized multipass build, using iozone for sequential read/write tests on a 2GB file, we get:

$ iozone -i 0 -r 64k -s 2G -w -f iozone.tmp
~ 29MB/s for writes

$ iozone -i 1 -r 64k -s 2G -f iozone.tmp
~ 34MB/s for reads

Based on before and after testing, the recent forced flush() on writes only had a minimal impact of ~2MB/s less in performance.

Also, I ran callgrind on multipassd when doing file operations on a mount and observed almost all of the time is spent in sha256_block_data_order() and AES_encrypt().

multipassd crashes after using a mount

Reproducing #81 I found this bug. Although building the actual snap doesn't need to be required, I'm not sure if the layout of that git repo is relevant to it.

multipassd crashes in connection to a mount.

> multipass launch --name=foo
> git clone https://github.com/LaughingLove/branch-diff-snap.git
> cd branch-diff-snap
> multipass mount . foo
> pwd
/home/cris/bau/branch-diff-snap
> multipass connect foo
> 
> multipass delete --purge foo
delete failed: Endpoint read failed

> dmesg
[...]
[115086.526647] multipassd[1929]: segfault at 73 ip 00000000004ff1ec sp 00007ffccbbbd560 error 4 in multipassd[400000+545000]

Need to implement an Output interface class

Now that we are starting to support different types of output, such as table, json, etc., we need to implement an output interface class for the different types, such as an Output base class, and then TableOutput, JsonOutput, YamlOutput, etc.

This will also make the output testable:)

NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_host_server unstable

https://travis-ci.org/MirServer/mir/jobs/332448350:

xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:86:34: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:87:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:88:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:89:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:90:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:91:27: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:92:27: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:93:27: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:94:27: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:95:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:96:29: string literal is not a valid UTF-8 string
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:96:29: too many errors
xkbcommon: ERROR: /usr/share/X11/locale/iso8859-1/Compose:96:29: failed to parse file
/spread/mir/tests/mir_test_framework/input_device_faker.cpp:80: Failure
Value of: counter->count_devices
Expected: is equal to 2
Actual: 0 (of type int)
/spread/mir/tests/acceptance-tests/test_nested_input.cpp:546: Failure
Value of: devices_ready.wait_for(60s)
Actual: false
Expected: true
[2018-01-23 19:42:22.543401] mirserver: Stopping
/spread/mir/tests/acceptance-tests/test_nested_input.cpp:534: Failure
Actual function call count doesn't match EXPECT_CALL(nested_event_filter, handle( mt::DeviceStateWithPosition(initial_x, initial_y)))...
Expected: to be called once
Actual: never called - unsatisfied and active
/spread/mir/tests/acceptance-tests/test_nested_input.cpp:538: Failure
Actual function call count doesn't match EXPECT_CALL(nested_event_filter, handle(AllOf(mt::PointerEventWithPosition(final_x, final_y), mt::PointerEventWithDiff(x[2], y[2]))))...
Expected: to be called once
Actual: never called - unsatisfied and active
[2018-01-23 19:42:22.561202] mirserver: Stopping
[ FAILED ] NestedInputWithMouse.mouse_pointer_position_is_in_sync_with_host_server (65129 ms)

multipass mount doesn't work - bash: sshfs: command not found

Created new VM, then made a directory I want to use between the VM and my host. I then tried to mount and it failed.

$ multipass mount  /home/alan/tmp/electron electron:/home/ubuntu/electron
mount failed: The following errors occured:
bash: sshfs: command not found

It appears to create the folder inside the VM, but then doesn't connect the two. Installing sshfs in the VM and then re-running the command worked.

Launching instances using shortcuts detailed in `multipass find` output

Firstly, thank you for this tool :)

I wanted to launch a bionic instance so I used multipass find to find the images available and was shown the following for bionic:

multipass launch …   Starts an instance of   Image version
----------------------------------------------------------
daily:18.04          Ubuntu 18.04 LTS        20180124
   (or: b, bionic, devel)

From this I assumed that I could try multipass launch --name bionic b or multipass launch --name bionic bionic or multipass launch --name bionic devel but this proved not to be the case. multipass launch --name bionic daily:18.04 did work as expected.

$ multipass launch --name bionic b
failed to launch: Too many images matching "b"          

$ multipass launch --name bionic bionic
failed to launch: Unable to find an image matching "bionic"

$ multipass launch --name bionicdevel devel
failed to launch: Unable to find an image matching "devel"  

Is this a bug or have I misunderstood the output of multipass find?

bash tab completion

It'd be useful to add support for bash tab completion. I think this is particularly useful for operations against instances, like multipass connect <tab>.

Support Ubuntu Desktop Images

I'm wondering how hard it would be to launch livecds -as that might not require cloud-init.

Also wondering if this could eventually replace: https://launchpad.net/testdrive for testing.

Obviously, it also might be useful to have cloud-init on desktops to do some automagic.

I plan to look into these more, but figured if anyone has answers or wants to try them first, have at it :)

VM is too small

Within a few minutes of sparking up a default 16.04 VM I'd run out of space. I think 2GB is a little too small to be actually useful. Perhaps 5G should be a default?

Need to delete the virtual bridge when multipassd shuts down

It is possible to get into a situation where multipassd tries to use a different subnet than what the existing mpbr0 device is using. This mainly affects develops, but for correctness, the bridge should be removed when multipassd exits.

We should also clean up the routing and iptables when multipassd exits.

Connect doesn't default if only one instance available

multipass connect has a require parameter. I have just issues multipass launch so there is only one system running. Given multipass knows exactly how many systems are available, it would be super convenient that if the number of instances == 1 then chances are I wanted to connect to that one.

Perhaps multipass launch followed by multipass connect could do the right thing and just connect me to the recently launched system?

KVM support detection not robust enough

Following the instructions in the README. I got the following issue.

$ sudo snap install multipass --beta --classic
multipass (beta) 2017.2.2 from 'saviq' installed
$ multipass launch --name foo
failed to launch: Could not access KVM kernel module: No such file or directory 
failed to initialize KVM: No such file or directory

mount command does not support directories with single or double quotes

mkdir /tmp/dquote\"
multipass mount /tmp/dquote\" foo:dquote

mount failed: The following errors occured:
error mounting "dquotes": bash: -c: line 0: unexpected EOF while looking for matching `"'
bash: -c: line 1: syntax error: unexpected end of file

mkdir /tmp/single\'
multipass mount /tmp/single\' foo:single

mount failed: The following errors occured:
error mounting "single": bash: -c: line 0: unexpected EOF while looking for matching `''
bash: -c: line 1: syntax error: unexpected end of file

Multipass description does not show the alias name

The command to run multipass is multipass, not multipass.ubuntu.

jamie@ubik:~$ snap info multipass
name:      multipass
summary:   Ubuntu at your fingertips
publisher: saviq
description: |
  Multipass gives you Ubuntu VMs in seconds. Just run `multipass.ubuntu create`
  and
  it'll do all the setup for you.
snap-id: mA11087v6dR3IEcQLgICQVjuvhUUBUKM
commands:
  - multipass
services:
  multipass.multipassd: simple, enabled, active
tracking:               edge
installed:              2017.2.1-3-g248ab13 (31) 44MB devmode
refreshed:              2017-12-07 11:45:27 +0000 UTC
channels:                                        
  stable:               –                             
  candidate:            –                             
  beta:                 2017.2.2            (37) 44MB classic
  edge:                 2017.2.2-4-g691449f (38) 44MB classic

Doesn't respect disk size with "GB" suffix

multipass launch -n foo -d 10GB -m 2G

Did not complain about the invalid disk size value but reverted silently to the default. It would be nice if it would refuse to go ahead to avoid issues after using the VM.

multipass launch -n foo -d 10G -m 2G works as expected.

$ multipass version
multipass 2017.2.2-full-1-g01a386f
multipassd 2017.2.2-full-1-g01a386f

When mouting over instance user's home directory, `mount` hangs

Ubuntu: 16.04.04
multipass: 2017.2.2

multipass launch -n charmtool
mkdir charmtool
multipass mount remote:/home/hatched/charmtool charmtool:/home/ubuntu

Now multipass list won't return, after ^C but multipass help does.

Restarting the host returns this back to the state before the mount was run.

`multipass mount` allows mounting over instance rootfs

multipass mount $PWD instance:/ is accepted (although it did crash on me once), sshfs is running inside the instance, but rootfs is fortunately safe.

When it did mount, trying to multipass umount instance sent the daemon into a loop somewhere.

Still, we should sanitize the target path somewhat.

Uses non-host DNS servers

I'm in an office (as it turns out Canonical) where there is no access to 8.8.8.8 which is the default DNS in multipass. Nothing resolves inside my multipass machine, but external host DNS resolution is fine.

This will also affect some of the software vendors we're talking to, who may use multipass as a way to have clean build environments for their software. If the multipass instance can't see internal repositories then it will fail to build. They may also have similar restrictions to us in terms of DNS access.

terminate called after throwing an instance of 'std::runtime_error'

I launched a multipass then started something intensive, and now the vm has locked up. I want to get in to debug it, but multipass connect won't let me. Now, I don't mind that I can't get in, I'll throw this away and start again, but the error message I get when I try and connect could do with some love:-

alan@hal:~$ multipass connect finer-mite 
terminate called after throwing an instance of 'std::runtime_error'
  what():  ssh: No route to host
Aborted (core dumped)

Multipass store metadata is wrong

alan@hal:~$ snap info multipass
name:      multipass
summary:   Ubuntu at your fingertips
publisher: saviq
description: |
  Multipass gives you Ubuntu VMs in seconds. Just run `multipass.ubuntu create`
  and
  it'll do all the setup for you.
snap-id: mA11087v6dR3IEcQLgICQVjuvhUUBUKM
commands:
  - multipass.ubuntu
services:
  multipass.multipassd: simple, enabled, active
tracking:               beta
installed:              2017.1.6 (30) 44MB devmode
refreshed:              2017-11-23 00:20:03 +0000 UTC
channels:                                        
  stable:               –                             
  candidate:            –                             
  beta:                 2017.2.2            (37) 44MB classic
  edge:                 2017.2.2-4-g691449f (38) 44MB classic

If I run the command listed there, it isn't found.

alan@hal:~$ multipass.ubuntu create
multipass.ubuntu: command not found

In addition, it isn't even create.

alan@hal:~$ multipass create
Error: Unkown Command: 'create', see "/snap/multipass/37/bin/multipass --help"

You will need to modify the store data directly in the store (not change it in your yaml) in order for the above snap info output to change.

multipass doesn't support core images

I'd like to test some features of Ubuntu Core inside multipass. Unfortunately multipass find core returns no images that I can boot in multipass.

What are the plans to support core in multipass?

core dumped when multipass connect fails

I launch instance with custom cloud-init which contains my public ssh key

# multipass launch -c 4 -m 16G -d 50G -n M1804 --cloud-init cinit.yaml daily:18.04
Launched: M1804   

I guess because ssh key is present, multipass connect is refused. But this is not expected in multipass handling (?)

# multipass connect M1804 
terminate called after throwing an instance of 'std::runtime_error'
  what():  ssh: Access denied. Authentication that can continue: publickey
Aborted (core dumped)

# multipass list
Name                    State    IPv4             Release
M1804                   RUNNING  10.122.122.6     Ubuntu 18.04 LTS
Mate-17-10              STOPPED  --               Ubuntu 17.10
podstest                STOPPED  --               Ubuntu 16.04 LTS
# ssh [email protected] 
works fine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.