カノニカルマルチパス入門


コンテナは嵐で世界を取った.それはDockerやロケットなどのアプリケーションコンテナ、またはOpenVZ、LXC/LXDまたはマルチパスなどのオペレーティングシステムコンテナです.
私はいつもかなり魅力的なコンテナを見つけました.理由は、きちんとしたクリーンなインターフェイスを使用して起動し、一度完了したら、すべての混乱をクリーンアップすることができますようにそこにはなかった.
このポストでは、Multipassを見て、Canonicalの背後にある同社、Ubuntuによるオペレーティングシステムのコンテナ化技術です.マルチパスは、Windows、Mac&Linuxで利用可能です.あなたの特定のオペレーティングシステムのinsallation命令のために
Linux用

  • Mac用
  • をクリックします
  • Windowsの
  • をクリックします
  • NOTE: If you are running Windows Professional, then Multipass can use the built-in Hyper-V technology. Alternatively you will have to install Oracle Virtualbox separately, to use Multipass.


    マルチパスを使用する方法にダイブ.
    Ubuntu VMを起動する最も簡単な方法は
    PS C:\Users\visha> multipass launch
    Launched: wise-llama
    PS C:\Users\visha> multipass list
    Name            State         IPv4         Image
    wise-llama      Running       N/A          Ubuntu 20.04 LTS
    PS C:\Users\visha>
    
    意志は最新のLTSバージョンでUbuntu VMをつくります.新しいVMが作成されるたびに、もちろんいくつかのリソース(RAM、CPU、ディスク領域など)が割り当てられます.リストする
    PS C:\Users\visha> multipass info wise-llama
    Name:           wise-llama
    State:          Running
    IPv4:           N/A
    Release:        Ubuntu 20.04.1 LTS
    Image hash:     69138d4bbf4f (Ubuntu 20.04 LTS)
    Load:           0.00 0.04 0.05
    Disk usage:     1.2G out of 4.7G
    Memory usage:   125.3M out of 981.3M
    PS C:\Users\visha>
    
    デフォルトでは、1 CPU、1 GBのRAM & 5 GBのディスク領域が割り当てられます.これはVMの起動時にパラメータを渡すことで変更できます.パラパラを知る
    PS C:\Users\visha> multipass help launch
    
    これは、マルチパスの起動に渡すことができるすべてのパラメータを出力します.カスタム設定でUbuntu VMを起動します.
    multipass launch -v -c 2 -d 10G -m 2G -n bionic 18.04
    
    VMが作成されると、ホストマシンから直接コマンドを発行できます.
    PS C:\Users\visha> multipass exec bionic -- lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 18.04.5 LTS
    Release:        18.04
    Codename:       bionic
    PS C:\Users\visha>
    
    また、VM内のシェルに直接アクセスすることもできます.
    PS C:\Users\visha> multipass shell bionic
    Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 4.15.0-124-generic x86_64)
    
     * Documentation:  https://help.ubuntu.com
     * Management:     https://landscape.canonical.com
     * Support:        https://ubuntu.com/advantage
    
      System information as of Sat Nov 28 06:06:54 +04 2020
    
      System load:  0.17              Processes:             84
      Usage of /:   22.1% of 4.67GB   Users logged in:       0
      Memory usage: 11%               IP address for enp0s3: 10.0.2.15
      Swap usage:   0%
    
    
    0 packages can be updated.
    0 updates are security updates.
    
    New release '20.04.1 LTS' available.
    Run 'do-release-upgrade' to upgrade to it.
    
    
    To run a command as administrator (user "root"), use "sudo <command>".
    See "man sudo_root" for details.
    
    ubuntu@bionic:~$
    
    現在、我々はUbuntu生物学的瞬間の中にいます.他のUbuntuインスタンスのようにこれを使用できます.一旦実行されると、割り当てられたRAM & CPUが自由になって、ホストマシンに戻るように、実行中のインスタンスを停止することができます.しかし、私たちがVMを止めたので、ディスク領域はまだ占有されます.ディスクスペースを回復するために、VMを削除して、パージしなければなりません.
    multipass delete <vm-nam>
    multipass purge
    
    マルチパスでサポートされているコマンドの一覧については、引数なしでマルチパスを実行します.特定のコマンドについての詳細を知るには
    PS C:\Users\visha> multipass
    Usage: Program Files\Multipass\bin\multipass.exe [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 the 'v' in the short option for more detail. Maximum verbosity is obtained with 4 (or more) v's, i.e. -vvvv.
    
    Available commands:
      delete    Delete instances
      exec      Run a command on an instance
      find      Display available images to create instances from
      get       Get a configuration setting
      help      Display help about a command
      info      Display information about instances
      launch    Create and start an Ubuntu instance
      list      List all available instances
      mount     Mount a local directory in the instance
      purge     Purge all deleted instances permanently
      recover   Recover deleted instances
      restart   Restart instances
      set       Set a configuration setting
      shell     Open a shell on a running instance
      start     Start instances
      stop      Stop running instances
      suspend   Suspend running instances
      transfer  Transfer files between the host and instances
      umount    Unmount a directory from an instance
      version   Show version details
    PS C:\Users\visha>
    
    それはすべての人々になります!

    For the case where Multipass is using VirtualBox, you need to download PSExec and the use the command


    PS> & $env:USERPROFILE\Downloads\PSTools\PsExec.exe -s -i $env:VBOX_MSI_INSTALL_PATH\VirtualBox.exe