Differences between revisions 1 and 2
Deletions are marked like this. Additions are marked like this.
Line 23: Line 23:

= How to Repair Root Filesystem =

 If we see in the console (s. GUI above) the following error message, than it is not possible to start the VM:
 {{{
An error occurred while mounting /.
keys: Press S to skip mounting or M for manual recovery.
}}}

 In that case stop the VM by ''"vagrant halt"'', find the appropriate VMDK file, e.g. ''/home/vagrant/VirtualBox VMs/geopy/box-disk1.vmdk'' and attach it to an existing VM with a similar command to the following (assumed that "geopy" is to be repaired and ''vmt3'' is used to attach to):
 {{{
$ VBoxManage storageattach eb0db1e2-688d-4477-b585-f8108a8b1cd6 --storagectl 'SATA Controller' --port 3 --device 0 --type hdd --medium ~/VirtualBox\ VMs/geopy/box-disk1.vmd
}}}

 The id of the VM can be found under ''/home/vagrant/vms/vmt3/.vagrant/machines/default/virtualbox/id''. The name of the storage controller and free port number can be fid out with ''"VBoxManage showvminfo eb0db1e2-688d-4477-b585-f8108a8b1cd6"''.
<<BR>>
 After the storage attached to the existing VM, start it up and perform e.g. ''"fsck /dev/sdb1"''. If it is ready, shutdown the VM, detach the VMDK file and start the repaired VM:

 {{{
$ cd vms/vmt3
$ vagrant halt
$ VBoxManage storageattach eb0db1e2-688d-4477-b585-f8108a8b1cd6 --storagectl 'SATA Controller' --port 3 --device 0 --type hdd --medium none
$ cd ../geopy
$ vagrant up
}}}

Vagrant Tips and Tricks

V2Master | V2Deployment

How to start a Vagrant VM with GUI

  • Sometime it may be necessary to start a VM with a GUI, e.g. to analyze a strange booting problem. However our servers have no GUI installed.

Login to our Host Server

  • Login to our host server as vagrant with X server redirection. It is recommended, that you copy your ssh key first to vagrant's authorized keys file. The example shows the situation with the MGT system on LU2.
    $ ssh -X vagrant@lu2.softxs.ch
    $ cd vms/mgt
    $ vi Vagrantfile    # add "v.gui = true" in section "config.vm.provider :virtualbox do |v|"
    $ vagrant reload

How to Repair Root Filesystem

  • If we see in the console (s. GUI above) the following error message, than it is not possible to start the VM:
    An error occurred while mounting /.
    keys: Press S to skip mounting or M for manual recovery.

    In that case stop the VM by "vagrant halt", find the appropriate VMDK file, e.g. /home/vagrant/VirtualBox VMs/geopy/box-disk1.vmdk and attach it to an existing VM with a similar command to the following (assumed that "geopy" is to be repaired and vmt3 is used to attach to):

    $ VBoxManage storageattach eb0db1e2-688d-4477-b585-f8108a8b1cd6 --storagectl 'SATA Controller' --port 3 --device 0 --type hdd --medium ~/VirtualBox\ VMs/geopy/box-disk1.vmd

    The id of the VM can be found under /home/vagrant/vms/vmt3/.vagrant/machines/default/virtualbox/id. The name of the storage controller and free port number can be fid out with "VBoxManage showvminfo eb0db1e2-688d-4477-b585-f8108a8b1cd6".


  • After the storage attached to the existing VM, start it up and perform e.g. "fsck /dev/sdb1". If it is ready, shutdown the VM, detach the VMDK file and start the repaired VM:

    $ cd vms/vmt3
    $ vagrant halt
    $ VBoxManage storageattach eb0db1e2-688d-4477-b585-f8108a8b1cd6 --storagectl 'SATA Controller' --port 3 --device 0 --type hdd --medium none
    $ cd ../geopy
    $ vagrant up

VagrantTipsAndTricks (last edited 2017-06-06 21:44:17 by TiborNagy)

Copyright 2008-2014, SoftXS GmbH, Switzerland