Instance Setup
Virtual Machines
8min
vast ai now offers full virtual machines (vms) in addition to docker based instance rentals feature comparison vms offer the following features not available in docker support for init managers (e g , systemd ) this is necessary for running docker, kubernetes, snap, or other containerization based applications within an instance support for process tracing ( ptrace ) vms have the following drawbacks compared to docker based instances slower creation and boot times higher disk overhead smaller selection of machines lesser availability of preconfigured templates only ssh launch mode currently supported creating a vm first, make sure that you have added your ssh keys to your account page first (see ssh guide https //docs vast ai/instances/sshscp ), as ssh keys cannot be edited on running vms ssh access is currently the only method preconfigured on vm instances use one of the below templates; the template will automatically filter for machines that support vms and will launch a vm when you rent with that template image (recommended template link) available launch modes description provides use cases notes docker io/vastai/kvm\ ubuntu terminal ( link https //cloud vast ai/?template id=e2f271ce754aeef772181fbf9c82a354 ) direct ssh a ubuntu 22 04 server vm cuda, docker serving docker compose applications; cuda performance profiling will refuse to start without ssh pubkeys set; ssh pubkeys will not be able to be changed while instance is running env variables will be written to /etc/environment and may need to be sourced by onstart onstart script will need interpreter specified via shebangs vm template customization vm images are packaged in docker images from the docker io/vastai/kvm repository vm templates must use one of these docker images add vms enabled=true to the extra filters field of the template to filter for machines that support vms vm images must be specified using the fully qualified server/organization/repo name docker options vm templates support the following flags in the "docker options" field these will have the same effect as in docker based instances environment variables " e jupyter dir=/ e test=ok" environment variables will be written to iframe{code=""} ports " p 8081 8081 p 8082 8082/udp p 70000 70000" for more details on these options, see environment https //docs vast ai/instances/docker execution environment launch modes currently only ssh is supported on start script the on start script field allows specifying a script to run on instance start unlike in docker based instances, the interpreter must be specified by a shebang (e g iframe{code=""} \ #!/bin/bash for bash ) other differences from docker based instances currently, the cloud copy utility for vms only allows migrating the entire vm, instead of allowing individual folders to be copied copy is only supported between two vms, not between vms and external cloud storage providers the copy utility for vms is invoked by vastai vm copy $src $dest