virtualbox iso issue

Discussions about all things Bitcraze
Post Reply
artistofcannae
Beginner
Posts: 22
Joined: Thu Nov 07, 2019 12:03 am

virtualbox iso issue

Post by artistofcannae » Thu Dec 26, 2019 10:38 pm

Hi,

I am still trying to set up the crazyflieVM on my computer that runs UBUNTU 18.04.1 (I posted and solved my own issue yesterday in my previous post)


I did this on another computer a while ago but I never had these issues:

So downloaded Virtualbox and the crazyflie VM file.
When trying to set everything up the README I tried double clicking on the
- createBitcrazeVM.sh

but when I do that this opens up instead of setting up the VM:


#!/bin/bash

PACKER_URL="https://releases.hashicorp.com/packer/0 ... ux_386.zip"

PACKER_FILE1=bitcrazeVM_createVM.json
PACKER_FILE2=bitcrazeVM_provisionVM.json

GCC_ARM_FILE="gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2"
GCC_ARM_URL="https://developer.arm.com/-/media/Files ... C_ARM_FILE"

ECLIPSE_FILE="eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz"
ECLIPSE_URL="http://ftp.halifax.rwth-aachen.de/eclip ... LIPSE_FILE"

ECLIPSE_GNU_ARM_PLUGIN_FILE="ilg.gnuarmeclipse.repository-2.12.1-201604190915.zip"
ECLIPSE_GNU_ARM_PLUGIN_URL="https://github.com/gnuarmeclipse/plug-i ... LUGIN_FILE"

OPENOCD_FILE="gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz"
OPENOCD_URL="https://github.com/gnuarmeclipse/openoc ... ENOCD_FILE"

CONTENT_DIR="contentForVM/"

OVA_FILE=BitcrazeVM.ova

#Install packer (only if it's not already installed)
if type "packer" > /dev/null
then
echo "Packer already installed. Continuing..."
else
echo "Packer is not installed. Installing..."
wget $PACKER_URL
unzip packer*.zip -d $HOME/packer
sudo ln -s $HOME/packer/packer /usr/bin/packer
rm packer*.zip
fi

#Download GCC ARM (63MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$GCC_ARM_FILE" ]
then
echo "$CONTENT_DIR$GCC_ARM_FILE found. Continuing..."
else
echo "$CONTENT_DIR$GCC_ARM_FILE not found. Starting download..."
wget -P $CONTENT_DIR $GCC_ARM_URL
fi

#Download Eclipse (182MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$ECLIPSE_FILE" ]
then
echo "$CONTENT_DIR$ECLIPSE_FILE found. Continuing..."
else
echo "$CONTENT_DIR$ECLIPSE_FILE not found. Starting download..."
wget -P $CONTENT_DIR $ECLIPSE_URL
fi

#Download Eclipse GNU ARM plugin (6MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$ECLIPSE_GNU_ARM_PLUGIN_FILE" ]
then
echo "$CONTENT_DIR$ECLIPSE_GNU_ARM_PLUGIN_FILE found. Continuing..."
else
echo "$CONTENT_DIR$ECLIPSE_GNU_ARM_PLUGIN_FILE not found. Starting download..."
wget -P $CONTENT_DIR $ECLIPSE_GNU_ARM_PLUGIN_URL
fi

#Download OpenOCD 0.9 (3MB) (only if it's not already downloaded)
if [ -f "$CONTENT_DIR$OPENOCD_FILE" ]
then
echo "$CONTENT_DIR$OPENOCD_FILE found. Continuing..."
else
echo "$CONTENT_DIR$OPENOCD_FILE not found. Starting download..."
wget -P $CONTENT_DIR $OPENOCD_URL
fi

# Compressing eclipse project files in one tgz
pushd .
echo "Compressing eclipse-project-files.tar.gz"
cd $CONTENT_DIR/eclipse-project-files
tar -czf ../eclipse-project-files.tar.gz *
popd

#Run packer
echo "Running packer..."
export PACKER_LOG=1

#If OVA already exists, skip VM creation step
if [ -f "output-virtualbox-iso/$OVA_FILE" ]
then
echo "OVA file found. Skipping VM creation..."
else
echo "OVA file not found. Starting VM creation..."
export PACKER_LOG_PATH="packerlog_create.txt"
packer build $PACKER_FILE1
fi
echo "Starting VM provisioning..."
export PACKER_LOG_PATH="packerlog_provision.txt"
packer build $PACKER_FILE2


So if I try to start the .SH file from the terminal I do:
.
/createBitcrazeVM.sh

and the following error arrises:

Packer already installed. Continuing...
contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 found. Continuing...
contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz found. Continuing...
contentForVM/ilg.gnuarmeclipse.repository-2.12.1-201604190915.zip found. Continuing...
contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz found. Continuing...
~/Desktop/bitcraze-vm-master ~/Desktop/bitcraze-vm-master
Compressing eclipse-project-files.tar.gz
~/Desktop/bitcraze-vm-master
Running packer...
OVA file not found. Starting VM creation...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Retrieving ISO
==> virtualbox-iso: Trying http://archive.ubuntu.com/ubuntu/dists/ ... t/mini.iso
==> virtualbox-iso: Trying http://archive.ubuntu.com/ubuntu/dists/ ... 68847f90da
==> virtualbox-iso: http://archive.ubuntu.com/ubuntu/dists/ ... 68847f90da => /home/edwin/Desktop/bitcraze-vm-master/packer_cache/5e92add049fe67b781c1efd7ded87ca3cc83e35c.iso
==> virtualbox-iso: Starting HTTP server on port 8365
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Error creating hard drive: VBoxManage error: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
==> virtualbox-iso: Progress state: NS_ERROR_INVALID_ARG
==> virtualbox-iso: VBoxManage: error: Failed to create medium
==> virtualbox-iso: VBoxManage: error: Cannot register the hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' {d430a755-4ad0-4bcc-9b30-54aabde7a8ae} because a hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' with UUID {b899f33f-6ef9-4e43-9bb1-59a1741d4018} already exists
==> virtualbox-iso: VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox
==> virtualbox-iso: VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 510 of file VBoxManageDisk.cpp
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error creating hard drive: VBoxManage error: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Failed to create medium
VBoxManage: error: Cannot register the hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' {d430a755-4ad0-4bcc-9b30-54aabde7a8ae} because a hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' with UUID {b899f33f-6ef9-4e43-9bb1-59a1741d4018} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox
VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 510 of file VBoxManageDisk.cpp

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error creating hard drive: VBoxManage error: 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...
Progress state: NS_ERROR_INVALID_ARG
VBoxManage: error: Failed to create medium
VBoxManage: error: Cannot register the hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' {d430a755-4ad0-4bcc-9b30-54aabde7a8ae} because a hard disk '/home/edwin/Desktop/bitcraze-vm-master/output-virtualbox-iso/BitcrazeVM.vdi' with UUID {b899f33f-6ef9-4e43-9bb1-59a1741d4018} already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_ARG (0x80070057), component VirtualBoxWrap, interface IVirtualBox
VBoxManage: error: Context: "RTEXITCODE handleCreateMedium(HandlerArg*)" at line 510 of file VBoxManageDisk.cpp

==> Builds finished but no artifacts were created.
Starting VM provisioning...
virtualbox-ovf output will be in this color.

1 error(s) occurred:

* Source file 'output-virtualbox-iso/BitcrazeVM.ova' needs to exist at time of config validation! stat output-virtualbox-iso/BitcrazeVM.ova: no such file or directory



What should I do? I am really confused.



arnaud
Bitcraze
Posts: 2272
Joined: Tue Feb 06, 2007 12:36 pm

Re: virtualbox iso issue

Post by arnaud » Fri Dec 27, 2019 2:16 pm

I think you are hitting this issue: https://github.com/bitcraze/bitcraze-vm/issues/45. You need VirtualBox 5 to run this script.

As I noted in your other post, you do not need this script to run the VM, it is used for development. You can download the pre-build VM from the release page: https://github.com/bitcraze/bitcraze-vm/releases/

artistofcannae
Beginner
Posts: 22
Joined: Thu Nov 07, 2019 12:03 am

Re: virtualbox iso issue

Post by artistofcannae » Fri Dec 27, 2019 4:07 pm

Hi,

Thank you for your help and advice.

I Downloaded VirtualBox 5.2.32 and used the prebuilt VM script but I am now getting this error:

not found. Starting download...
wget: missing URL
Usage: wget [OPTION]... [URL]...

Try `wget --help' for more options.
Packer already installed. Continuing...
contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2 not found. Starting download...
--2019-12-27 11:03:26-- https://developer.arm.com/-/media/Files ... ux.tar.bz2
Resolving developer.arm.com (developer.arm.com)... 23.47.18.244
Connecting to developer.arm.com (developer.arm.com)|23.47.18.244|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://armkeil.blob.core.windows.net/d ... ux.tar.bz2 [following]
--2019-12-27 11:03:27-- https://armkeil.blob.core.windows.net/d ... ux.tar.bz2
Resolving armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)... 52.239.137.100
Connecting to armkeil.blob.core.windows.net (armkeil.blob.core.windows.net)|52.239.137.100|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 100600407 (96M) [application/octet-stream]
Saving to: ‘contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2’

gcc-arm-none-eabi-7-2018-q2-upda 100%[========================================================>] 95.94M 2.44MB/s in 39s

2019-12-27 11:04:06 (2.48 MB/s) - ‘contentForVM/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2’ saved [100600407/100600407]

contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz not found. Starting download...
--2019-12-27 11:04:06-- http://ftp.halifax.rwth-aachen.de/eclip ... _64.tar.gz
Resolving ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)... 137.226.34.46, 2a00:8a60:e012:a00::21
Connecting to ftp.halifax.rwth-aachen.de (ftp.halifax.rwth-aachen.de)|137.226.34.46|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 236908195 (226M) [application/octet-stream]
Saving to: ‘contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz’

eclipse-cpp-2018-09-linux-gtk-x8 100%[========================================================>] 225.93M 10.1MB/s in 32s

2019-12-27 11:04:39 (6.96 MB/s) - ‘contentForVM/eclipse-cpp-2018-09-linux-gtk-x86_64.tar.gz’ saved [236908195/236908195]

contentForVM/ilg.gnuarmeclipse.repository-2.12.1-201604190915.zip found. Continuing...
contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz not found. Starting download...
--2019-12-27 11:04:39-- https://github.com/gnuarmeclipse/openoc ... 190955.tgz
Resolving github.com (github.com)... 140.82.114.4
Connecting to github.com (github.com)|140.82.114.4|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/ilg-archived/openocd ... 190955.tgz [following]
--2019-12-27 11:04:39-- https://github.com/ilg-archived/openocd ... 190955.tgz
Reusing existing connection to github.com:443.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset ... tet-stream [following]
--2019-12-27 11:04:39-- https://github-production-release-asset ... tet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.216.134.235
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.216.134.235|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2381724 (2.3M) [application/octet-stream]
Saving to: ‘contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz’

gnuarmeclipse-openocd-debian32-0 100%[========================================================>] 2.27M 9.92MB/s in 0.2s

2019-12-27 11:04:40 (9.92 MB/s) - ‘contentForVM/gnuarmeclipse-openocd-debian32-0.9.0-201505190955.tgz’ saved [2381724/2381724]

~/Desktop/bitcraze-vm-2018.12 ~/Desktop/bitcraze-vm-2018.12
Compressing eclipse-project-files.tar.gz
~/Desktop/bitcraze-vm-2018.12
Running packer...
OVA file not found. Starting VM creation...
virtualbox-iso output will be in this color.

==> virtualbox-iso: Retrieving ISO
==> virtualbox-iso: Trying http://archive.ubuntu.com/ubuntu/dists/ ... t/mini.iso
==> virtualbox-iso: Trying http://archive.ubuntu.com/ubuntu/dists/ ... 68847f90da
mini.iso 64.00 MiB / 64.00 MiB [======================================================================================] 100.00% 5s
==> virtualbox-iso: http://archive.ubuntu.com/ubuntu/dists/ ... 68847f90da => /home/edwin/Desktop/bitcraze-vm-2018.12/packer_cache/5e92add049fe67b781c1efd7ded87ca3cc83e35c.iso
==> virtualbox-iso: Starting HTTP server on port 8568
==> virtualbox-iso: Creating virtual machine...
==> virtualbox-iso: Creating hard drive...
==> virtualbox-iso: Creating forwarded port mapping for communicator (SSH, WinRM, etc) (host port 4371)
==> virtualbox-iso: Executing custom VBoxManage commands...
virtualbox-iso: Executing: modifyvm BitcrazeVM --memory 1024 --vram 16 --mouse usbtablet --rtcuseutc on --audio pulse --audiocodec ad1980 --usb on --usbehci on --nestedpaging off
virtualbox-iso: Executing: storageattach BitcrazeVM --storagectl SATA Controller --port 0 --nonrotational on --discard on
==> virtualbox-iso: Starting the virtual machine...
==> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: Implementation of the USB 2.0 controller not found!
==> virtualbox-iso: VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
==> virtualbox-iso: VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
==> virtualbox-iso: VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole
==> virtualbox-iso: Deregistering and deleting VM...
==> virtualbox-iso: Deleting output directory...
Build 'virtualbox-iso' errored: Error starting VM: VBoxManage error: VBoxManage: error: Implementation of the USB 2.0 controller not found!
VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: Implementation of the USB 2.0 controller not found!
VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component ConsoleWrap, interface IConsole

==> Builds finished but no artifacts were created.
Starting VM provisioning...
virtualbox-ovf output will be in this color.

1 error(s) occurred:

* Source file 'output-virtualbox-iso/BitcrazeVM.ova' needs to exist at time of config validation! stat output-virtualbox-iso/BitcrazeVM.ova: no such file or directory

arnaud
Bitcraze
Posts: 2272
Joined: Tue Feb 06, 2007 12:36 pm

Re: virtualbox iso issue

Post by arnaud » Fri Dec 27, 2019 6:10 pm

You apparently do not have the right expantion pack installed:
--> virtualbox-iso: Error starting VM: VBoxManage error: VBoxManage: error: Implementation of the USB 2.0 controller not found!
VBoxManage: error: Because the USB 2.0 controller state is part of the saved VM state, the VM cannot be started. To fix this problem, either install the 'Oracle VM VirtualBox Extension Pack' or disable USB 2.0 support in the VM settings.
VBoxManage: error: Note! This error could also mean that an incompatible version of the 'Oracle VM VirtualBox Extension Pack' is installed (VERR_NOT_FOUND)
You can download it from the virtualbox website.

What are you trying to achieve? If you just want to run the VM, this script is not the way to go, you should download the already made OVA file from the release page I linked earlier.

artistofcannae
Beginner
Posts: 22
Joined: Thu Nov 07, 2019 12:03 am

Re: virtualbox iso issue

Post by artistofcannae » Fri Dec 27, 2019 8:11 pm

I apologize I have just been misunderstanding which one I was suppose download. My bad I completely misunderstood what I was supposed to do.

But there is yet another issue:
when using the OVA file I get the following error:

Failed to import appliance /home/edwin/Downloads/BitcrazeVM_2018.12 (2).ova.

Do you have any idea why this happens?

artistofcannae
Beginner
Posts: 22
Joined: Thu Nov 07, 2019 12:03 am

Re: virtualbox iso issue

Post by artistofcannae » Sun Dec 29, 2019 7:34 pm

I found what the remaining issue was. it stemmed from the fact that there was not enough space on my computer for the VM to be installed. after increasing the amount of space I was able to set up the VM.

I would like to thank arnaud for your help. I apologize for my initial lack of understanding of the which was the correct download.

arnaud
Bitcraze
Posts: 2272
Joined: Tue Feb 06, 2007 12:36 pm

Re: virtualbox iso issue

Post by arnaud » Tue Jan 07, 2020 9:23 am

Great that your problem was solved!

Post Reply