... | ... | @@ -3,10 +3,7 @@ This page helps with troubleshooting of the common errors, either with the Cyber |
|
|
# Issues with generating sandboxes with CSC (for advanced users)
|
|
|
|
|
|
* The name of the correct network interface can be different for every box. The supported boxes are listed in the file `name_mappings/interface.yml`. If your box is not on the list, the most common "eth1" will be used. If you get an error during `$ vagrant up` about a non-existing network interface, you can add the name of your box and the correct network interface to the list manually.
|
|
|
|
|
|
* In rare cases, Python cannot find the module ruamel.yaml, even if it is installed (`ModuleNotFoundError: No module named 'ruamel.yaml'
|
|
|
`). Try to update the module (`pip3 install ruamel.yaml --upgrade`).
|
|
|
|
|
|
* In rare cases, Python cannot find the module ruamel.yaml, even if it is installed (`ModuleNotFoundError: No module named 'ruamel.yaml'` ). Try to update the module (`pip3 install ruamel.yaml --upgrade`).
|
|
|
* After running CSC on Windows, the output may contain invalid multibyte chars. This is a known issue that has not been resolved yet.
|
|
|
|
|
|
# Issues with running (instantiating) CSC sandboxes (for most users)
|
... | ... | @@ -19,11 +16,9 @@ Many errors can be simply resolved by running[`vagrant destroy -f`](https://www. |
|
|
4. [Errors specific to Windows host OS](#errors-windows)
|
|
|
5. [Errors specific to Linux host OS](#errors-linux)
|
|
|
|
|
|
<a name="errors-vagrant-up"></a>
|
|
|
## 1. General errors during vagrant up
|
|
|
|
|
|
* Check that the active directory in your command line is the directory with the Vagrantfile.
|
|
|
|
|
|
* Many errors are caused when you try to create the machines using another provider than "virtualbox", for example, "libvirt". You can recognize this by a message similar to `Bringing machine 'name' up with 'libvirt' provider` right after you run `vagrant up`. In this case, you have to explicitly ask for VirtualBox by running `vagrant up --provider virtualbox`.
|
|
|
|
|
|
### Error while executing VBoxManage, a CLI used by Vagrant
|
... | ... | @@ -40,29 +35,32 @@ VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, |
|
|
```
|
|
|
|
|
|
When receiving a message similar to the one above, try these steps:
|
|
|
|
|
|
* Run [`vagrant reload`](https://www.vagrantup.com/docs/cli/reload).
|
|
|
* If that did not help, it may be that the files downloaded for the box were corrupted or incomplete.
|
|
|
* Follow the steps for resolving the issue "An error occurred while downloading the remote file" below.
|
|
|
* If that did not help, check if you currently have (or had in the past) multiple versions of VirtualBox installed. If you do, *remove them* along with all remnants of configuration files. Past traces of previous versions of VirtualBox can still be used by the new installation, which can cause huge problems.
|
|
|
* If you are on Linux, [this comment](https://github.com/openebs/openebs/issues/71#issuecomment-302656291) deals with removing VirtualBox. Then, ensure you installed new VirtualBox by downloading the package from https://www.virtualbox.org/wiki/Linux_Downloads
|
|
|
* Follow the steps for resolving the issue "An error occurred while downloading the remote file" below.
|
|
|
* If that did not help, check if you currently have (or had in the past) multiple versions of VirtualBox installed. If you do, _remove them_ along with all remnants of configuration files. Past traces of previous versions of VirtualBox can still be used by the new installation, which can cause huge problems.
|
|
|
* If you are on Linux, [this comment](https://github.com/openebs/openebs/issues/71#issuecomment-302656291) deals with removing VirtualBox. Then, ensure you installed new VirtualBox by downloading the package from https://www.virtualbox.org/wiki/Linux_Downloads
|
|
|
* If that did not help:
|
|
|
* and you are on Windows, check that Hyper-V is disabled (see the [Installation page](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/wikis/Installation#windows-10)).
|
|
|
* and you are on Windows, check that Hyper-V is disabled (see the [Installation page](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/wikis/Installation#windows-10)).
|
|
|
|
|
|
### There was an error when attempting to rsync a synced folder
|
|
|
|
|
|
When you receive the error message above, try these steps:
|
|
|
|
|
|
* Check that you satisfy [the prerequisites of running rsync](https://www.vagrantup.com/docs/synced-folders/rsync#prerequisites).
|
|
|
* If that did not help, edit the Vagrantfile and change or disable the [option for rsyncing folders](https://www.dissmeyer.com/2020/02/11/issue-with-centos-7-vagrant-boxes-on-windows-10/).
|
|
|
* If that did not help:
|
|
|
* Destroy all remnants of the sandbox, then delete its folder
|
|
|
* Reinstall Vagrant.
|
|
|
* Reboot your host computer.
|
|
|
* Clone the sandbox again.
|
|
|
* Run `vagrant up` again. If you are on Windows, do *not* run Powershell as Administrator.
|
|
|
* Destroy all remnants of the sandbox, then delete its folder
|
|
|
* Reinstall Vagrant.
|
|
|
* Reboot your host computer.
|
|
|
* Clone the sandbox again.
|
|
|
* Run `vagrant up` again. If you are on Windows, do _not_ run Powershell as Administrator.
|
|
|
|
|
|
### An error occurred while downloading the remote file
|
|
|
### An error occurred while downloading the remote file
|
|
|
|
|
|
When you receive the error message above, check the following:
|
|
|
|
|
|
* Your Internet connection is functional and stable. (If you experience even short outages of your connection, this can cause the download to fail.)
|
|
|
* You have enough disk space for downloading the box. (This can sometimes be tens of GB.)
|
|
|
* The download process has rights for writing into the target folder.
|
... | ... | @@ -82,6 +80,7 @@ This is most likely your antivirus blocking the download of boxes from Vagrant c |
|
|
### Repository changed its Suite value from stable to oldstable
|
|
|
|
|
|
When you receive the error message above, the most likely cause is that the box you are using has been updated on [Vagrant cloud](https://app.vagrantup.com/boxes/search). To resolve the error:
|
|
|
|
|
|
* Destroy the sandbox
|
|
|
* [Update your local copy of the Vagrant box](https://www.vagrantup.com/docs/cli/box#box-update) you are trying to instantiate
|
|
|
* Run the sandbox again
|
... | ... | @@ -89,6 +88,7 @@ When you receive the error message above, the most likely cause is that the box |
|
|
### Using a Windows machine with Ansible installed on the host OS
|
|
|
|
|
|
This issue is relevant only when using Linux or macOS as host OS. If the sandbox contains a Windows machine and it was generated with the `--ansible-installed` option, an error appears during the building process:
|
|
|
|
|
|
```
|
|
|
fatal: [windows]: UNREACHABLE! => {
|
|
|
"changed": false,
|
... | ... | @@ -96,33 +96,27 @@ fatal: [windows]: UNREACHABLE! => { |
|
|
"unreachable": true
|
|
|
}
|
|
|
```
|
|
|
This error can be solved by regenerating the sandbox without `--ansible-installed`.
|
|
|
|
|
|
This error can be solved by regenerating the sandbox without `--ansible-installed`.
|
|
|
|
|
|
<a name="errors-vagrant-up-stuck"></a>
|
|
|
## 2. Getting stuck during vagrant up (the process freezes)
|
|
|
|
|
|
* The environment creation sometimes hangs on `br: Running ansible-playbook...`. At this stage, the environment is already fully built, and the execution can be stopped by killing the process (e.g., using Ctrl + C).
|
|
|
|
|
|
* Vagrant up can get stuck on `SSH auth method: private key` in case of "generic/debian10" box or on `SSH auth method: password` in case of "kalilinux/rolling-light" box. This is probably an issue of VirtualBox. In this case, destroy the machine, reboot, and create it again. In the case of "kalilinux/rolling-light" remove the line `device.ssh.password = "vagrant"` from the generated Vagrantfile and try to bring it up again.
|
|
|
|
|
|
* On some machines, the Ansible local provisioning (enabled by the `--ansible_local` flag) can get stuck while connecting to the created virtual machine. Try destroying the machines, rebooting, and creating them again.
|
|
|
|
|
|
<a name="errors-vms"></a>
|
|
|
## 3. Errors with the created virtual machines
|
|
|
|
|
|
* When the machines in the sandbox are not reachable over the virtual network (i.e., `ping` does not work), restart networking at all machines: `sudo service networking restart`.
|
|
|
|
|
|
* If any of the required services in the sandbox do not run, destroy the particular machine and instantiate it again.
|
|
|
|
|
|
* If you experience issues during/after the virtual machines boot, check if DHCP server for vboxnet0 is turned off in VirtualBox. It can be done manually in VirtualBox or with the command `$ VBoxManage dhcpserver remove --ifname vboxnet0`.
|
|
|
* If the Vagrant box "munikypo/kali-2019.4" is started with insufficient memory, it fails to boot with error `---\\\[ end Kernel panic - not syncing: System is deadlocked on memory \\\]---`. Please see the [minimum memory requirements](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/wikis/Sandbox-Definitions#supported-vagrant-boxes).
|
|
|
* If the sandbox contains Vagrant box "munikypo/kali" version 0.1.1 and fails on `RUNNING HANDLER \\\[interface : interface_networking_restart\\\]` with `"Unable to restart service networking: Job for networking.service failed because the control process exited with error code.`, change the version of the box in Vagrantfile to 0.1.0: add `device.vm.box_version = "0.1.0"` under `device.vm.box = "munikypo/kali"`.
|
|
|
|
|
|
* If the Vagrant box "munikypo/kali-2019.4" is started with insufficient memory, it fails to boot with error `---[ end Kernel panic - not syncing: System is deadlocked on memory ]---`. Please see the [minimum memory requirements](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/wikis/Sandbox-Definitions#supported-vagrant-boxes).
|
|
|
|
|
|
<a name="errors-windows"></a>
|
|
|
## 4. Errors specific to Windows host operating system
|
|
|
|
|
|
Many errors on Windows are caused by the following:
|
|
|
|
|
|
* Having non-English characters in the file path to the sandbox (see also "Incompatible character encodings" below)
|
|
|
* Running PowerShell as Administrator. Surprisingly, it can help if you run PowerShell as a regular user for almost all tasks. Admin PowerShell searches extended file paths to Vagrant and its boxes, which may cause duplicities and problems.
|
|
|
|
... | ... | @@ -160,8 +154,9 @@ incompatible character encodings: Windows-1250 and CP852 (Encoding::Compatibilit |
|
|
```
|
|
|
|
|
|
To address it, try these steps:
|
|
|
1. Run Vagrant in a directory that does not contain diacritic marks. For example, instead of `C:\Users\Příliš-žluťoučký-kůň\sandbox`, move your sandbox directory to `C:\Users\John\sandbox`.
|
|
|
2. If that does not help, set an environment variable `VAGRANT_HOME` to the path to Vagrant executable, for example `C:\HashiCorp`.
|
|
|
|
|
|
1. Run Vagrant in a directory that does not contain diacritic marks. For example, instead of `C:\\\\Users\\\\Příliš-žluťoučký-kůň\\\\sandbox`, move your sandbox directory to `C:\\\\Users\\\\John\\\\sandbox`.
|
|
|
2. If that does not help, set an environment variable `VAGRANT_HOME` to the path to Vagrant executable, for example `C:\\\\HashiCorp`.
|
|
|
|
|
|
### Appliance import failed
|
|
|
|
... | ... | @@ -179,7 +174,6 @@ handleImportAppliance(struct HandlerArg *)" at line 1119 of file VBoxManageAppli |
|
|
|
|
|
* After running `vagrant up`, PowerShell can stop sending output until Enter is pressed. This is a feature of PowerShell that can be [disabled](https://serverfault.com/questions/204150/sometimes-powershell-stops-sending-output-until-i-press-enter-why).
|
|
|
|
|
|
<a name="errors-linux"></a>
|
|
|
## 5. Errors specific to Linux host operating system
|
|
|
|
|
|
* When getting errors during `vagrant up` complaining about 'vboxdrv', check out [this discussion](https://askubuntu.com/questions/760671/could-not-load-vboxdrv-after-upgrade-to-ubuntu-16-04-and-i-want-to-keep-secur) and [this blog post](https://stegard.net/2016/10/virtualbox-secure-boot-ubuntu-fail/).
|
... | ... | @@ -188,9 +182,10 @@ handleImportAppliance(struct HandlerArg *)" at line 1119 of file VBoxManageAppli |
|
|
|
|
|
### Blinking VM GUI
|
|
|
|
|
|
The GUI of some virtual machines, such as Kali, are blinking on macOS ([issue #91](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/issues/91)). This issue can be solved by adding the line `vb.customize ["modifyvm", :id, "--graphicscontroller", "vmsvga"]` to the __Vagrantfile__ in the _Intermediate Definition_. The correct place to do that is under the `device.vm.provider` section of the blinking VM definition (`config.vm.define`).
|
|
|
The GUI of some virtual machines, such as Kali, are blinking on macOS ([issue #91](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/issues/91 "GUI of some VMs are blinking on macOS")). This issue can be solved by adding the line `vb.customize \\\["modifyvm", :id, "--graphicscontroller", "vmsvga"\\\]` to the **Vagrantfile** in the _Intermediate Definition_. The correct place to do that is under the `device.vm.provider` section of the blinking VM definition (`config.vm.define`).
|
|
|
|
|
|
The relevant part of the Vagrantfile may look like this:
|
|
|
|
|
|
```ruby
|
|
|
config.vm.define "home" do |device|
|
|
|
device.vm.hostname = "home"
|
... | ... | |