|
|
This page helps with troubleshooting of the common errors, either with the Cyber Sandbox Creator (CSC) itself, or with instantiating the generated sandbox using Vagrant.
|
|
|
|
|
|
# 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`).
|
|
|
|
|
|
* 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)
|
|
|
|
|
|
Many errors can be simply resolved by running[`vagrant destroy -f`](https://www.vagrantup.com/docs/cli/destroy), rebooting your computer, and running [`vagrant up`](https://www.vagrantup.com/docs/cli/up) again. If that does not help, try to search for your error below.
|
|
|
|
|
|
1. [General errors during vagrant up](#errors-vagrant-up)
|
|
|
2. [Getting stuck during vagrant up](#errors-vagrant-up-stuck)
|
|
|
3. [Errors with the created virtual machines](#errors-vms)
|
|
|
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
|
|
|
|
|
|
```
|
|
|
==> server: Booting VM...
|
|
|
There was an error while executing VBoxManage, a CLI used by Vagrant
|
|
|
for controlling VirtualBox. The command and stderr is shown below.
|
|
|
|
|
|
Command: ["startvm", "007ab888-e415-4f3a-9a4a-3682504c718a", "--type", "headless"]
|
|
|
|
|
|
Stderr: VBoxManage.exe: error: The virtual machine 'my-sandbox' has terminated unexpectedly during startup with exit code 1 (0x1). More details may be available in 'C:\Users\Me\VirtualBox VMs\my-sandbox_1514560086822_51787\Logs\VBoxHardening.log'
|
|
|
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine
|
|
|
```
|
|
|
|
|
|
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
|
|
|
* 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)).
|
|
|
|
|
|
### 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.
|
|
|
|
|
|
### 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.
|
|
|
|
|
|
Then remove the problematic box using [`vagrant box remove <box_name>`](https://www.vagrantup.com/docs/cli/box#box-remove). If you downloaded other boxes at the same time when this error occurred, you may also need to remove these other boxes (even though they may have seemed to finish successfully). Then, run `vagrant up` again, and ensure the download process is not interrupted.
|
|
|
|
|
|
### The checksum of the downloaded box did not match the expected value
|
|
|
|
|
|
The downloaded box may be corrupted when the download process is interrupted or cannot properly store the file on your filesystem (e.g., because of disk space constraints or insufficient rights). Then, the downloaded file is different and the hash checksums do not match.
|
|
|
|
|
|
To resolve this issue, try the same steps as for resolving "An error occurred while downloading the remote file" above.
|
|
|
|
|
|
### InitializeSecurityContext failed
|
|
|
|
|
|
This is most likely your antivirus blocking the download of boxes from Vagrant cloud (especially Kaspersky antivirus is known to cause this issue). Please try temporarily disabling your antivirus software, or at least create an exception for Vagrant (see [this example for Kaspersky](https://stackoverflow.com/a/70220883).)
|
|
|
|
|
|
### 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
|
|
|
|
|
|
<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).
|
|
|
|
|
|
<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.
|
|
|
|
|
|
### Non-ASCII character error when installing pip
|
|
|
|
|
|
When receiving a message similar to the one below, ensure Hyper-V is disabled (see the [Installation page](https://gitlab.ics.muni.cz/muni-kypo-csc/cyber-sandbox-creator/-/wikis/Installation#windows-10)).
|
|
|
|
|
|
```
|
|
|
server: Installing pip... (for Ansible installation)
|
|
|
The following SSH command responded with a non-zero exit status.
|
|
|
Vagrant assumes that this means the command failed!
|
|
|
|
|
|
curl https://bootstrap.pypa.io/get-pip.py | sudo python
|
|
|
|
|
|
Stdout from the command:
|
|
|
|
|
|
|
|
|
|
|
|
Stderr from the command:
|
|
|
|
|
|
% Total % Received % Xferd Average Speed Time Time Time Current
|
|
|
Dload Upload Total Spent Left Speed
|
|
|
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 File "<stdin>", line 936
|
|
|
SyntaxError: Non-ASCII character '\xf3' in file <stdin> on line 937, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
|
|
|
7 1842k 7 136k 0 0 750k 0 0:00:02 --:--:-- 0:00:02 754k
|
|
|
curl: (23) Failed writing body (793 != 1371)
|
|
|
```
|
|
|
|
|
|
### Incompatible character encodings
|
|
|
|
|
|
During `vagrant up`, a following error message may occur.
|
|
|
|
|
|
```
|
|
|
incompatible character encodings: Windows-1250 and CP852 (Encoding::CompatibilityError)
|
|
|
```
|
|
|
|
|
|
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`.
|
|
|
|
|
|
### Appliance import failed
|
|
|
|
|
|
If you receive the error below, check that you have enough disk space for the sandbox. Some can require even dozens of GB. If space was not an issue, follow [this guide](https://stackoverflow.com/a/62042683) for troubleshooting.
|
|
|
|
|
|
```
|
|
|
Progress state: E_INVALIDARG
|
|
|
VBoxManage.exe: error: Appliance import failed
|
|
|
VBoxManage.exe: error: Code E_INVALIDARG (0x80070057) - One or more arguments are invalid
|
|
|
(extended info not available) VBoxManage.exe: error: Context: "enum RTEXITCODE __cdecl
|
|
|
handleImportAppliance(struct HandlerArg *)" at line 1119 of file VBoxManageAppliance.cpp
|
|
|
```
|
|
|
|
|
|
### PowerShell stops sending output
|
|
|
|
|
|
* 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/).
|
|
|
|
|
|
## My issue is not covered above! What should I do?
|
|
|
|
|
|
If you are a student of FI MUNI PV080 course, please post the information below to the respective IS MU Discussion forum.\
|
|
|
If not, please contact [Valdemar Švábenský](mailto:svabensky@ics.muni.cz?subject=Cyber%20Sandbox%20Creator%20Issue) directly and include the information below in your e-mail.
|
|
|
|
|
|
* What were you trying to do with Cyber Sandbox Creator?
|
|
|
* What was the topology definition?
|
|
|
* What command were you trying to execute?
|
|
|
* What was the exact error message on which the process crashed?
|
|
|
* What is your host operating system?
|
|
|
* What is your Vagrant version? (Run `vagrant -v` in your command line.)
|
|
|
* What is your VirtualBox version?
|
|
|
* What is the output of the command `vagrant box list` in the command line?
|
|
|
|
|
|
Alternatively, you can submit an issue directly in the CSC Gitlab repository. |
|
|
\ No newline at end of file |