Search code examples
amazon-web-servicesvagrantamazon-workspaces

Run Vagrant on Amazon Workspaces


I'm trying to set up a web development environment on Amazon Workspaces running Amazon Linux AMI, but I didn't find a way to install Vagrant on the machine. I would like to have a virtual webdev machine for various practical reasons, but it seems that I can't run vagrant as AWS is already virtualised. Is that correct, or is there a way to install and run vagrant/virtualbox containers on AWS Workspace?


Solution

  • AWS workspaces only offers a limited number of packages within its repo manager, so you won't find vagrant there. But you can manually install the repo using the CentOS download on their website. For example, this worked for me inside my Linux AMI WorkSpace:

    wget https://releases.hashicorp.com/vagrant/2.1.2/vagrant_2.1.2_x86_64.rpm
    yum install vagrant_2.1.2_x86_64.rpm
    

    Now a WorkSpace is essentially a virtualized environment, so its unlikely you will be able to run a vm inside it - See this.

    However vagrant offers a number of providers other than the default - including aws, which will allow you to spin up a vagrant box on an ec2 instance rather than locally. You can install it as follows:

    vagrant plugin install vagrant-aws
    

    And follow the configuration steps here