Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error creating a new vm "The hard disk storage unit at location ... already exists" #99

Open
d3xt3r01 opened this issue Feb 9, 2018 · 5 comments

Comments

@d3xt3r01
Copy link

d3xt3r01 commented Feb 9, 2018

Hi awesome peeps. Glad to see the project is alive again and kicking !
I have a problem for a while now not being able to create vms.

OS: Gentoo

VirtualBox: 5.2.6
apache 2.4.29
php-fpm 7.0.27
Phpvirtualbox: git:develop@788f43e
vboxwebsrv runs as user vbox !

$ ps aux | grep -i vbox
vbox      5035  0.0  0.0 103420 11000 ?        S    10:24   0:00 /usr/lib64/virtualbox/VBoxXPCOMIPCD
vbox      9348  0.0  0.0 950492 27784 ?        Ssl  10:40   0:00 /usr/lib64/virtualbox/vboxwebsrv -H 127.0.0.1 -p 18083 -t 20 -i 5
vbox     13922  0.0  0.0 596204 19944 ?        Sl   10:50   0:00 /usr/lib64/virtualbox/VBoxSVC --auto-shutdown
root     26465  0.0  0.0      0     0 ?        I<   Feb06   0:00 [iprt-VBoxWQueue]
root     26469  0.0  0.0      0     0 ?        S    Feb06   0:00 [iprt-VBoxTscThr]

In config.php I have the following set:

var $username = 'vbox';
var $password = 'password'; // not the actual password
var $location = 'http://127.0.0.1:18083/';

So on a fresh new setup, I log in the phpvirtualbox web interface and do this:
Click New
Name and operating system: Name: test ( leave defaults, linux, debian 32bit )
Click next
Memory size: Leave defaults ( 1024 )
Click next
Hard disk: Leave defaults ( Create a virtual hard disk now )
Click Create
Hard disk file type: Leave defaults ( vdi )
Click next
Storage on physical hard disk: Leave defaults ( Dynamically allocated )
Click next
File location and size: Leave defaults ( test, 8GB )
Click Create

A new message appears

The hard disk storage unit at location /home/vbox/.VirtualBox/Machines/test/test.vdi already exists. You cannot create a new virtual hard disk that uses this location because it can be already used by another virtual hard disk.

Please specify a different location.

A new message appears

Error logging in or connecting to vboxwebsrv.

Exception Object
(
    [message:protected] => Error logging in or connecting to vboxwebsrv.
    [string:Exception:private] => 
    [code:protected] => 64
    [file:protected] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxconnector.php
    [line:protected] => 226
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxconnector.php
                    [line] => 376
                    [function] => connect
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                        )

                )

            [1] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxconnector.php
                    [line] => 951
                    [function] => remote_getEvents
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                )

                        )

                )

            [2] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/api.php
                    [line] => 316
                    [function] => __call
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => getEvents
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                        )

                                    [1] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [data] => Array
                                                        (
                                                            [responseData] => Array
                                                                (
                                                                )

                                                        )

                                                    [errors] => Array
                                                        (
                                                        )

                                                    [persist] => Array
                                                        (
                                                        )

                                                    [messages] => Array
                                                        (
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

    [previous:Exception:private] => 
)


Location:http://127.0.0.1:18083/

A new message appears

An error occurred communicating with your vboxwebsrv. No more requests will be sent by phpVirtualBox until the error is corrected and this page is refreshed. The details of this connection error should be displayed in a subsequent dialog box.

A new message appears:

VirtualBox error: rc=0x80004004
SoapFault Object
(
    [message:protected] => VirtualBox error: rc=0x80004004
    [string:Exception:private] => 
    [code:protected] => 0
    [file:protected] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxServiceWrappers.php
    [line:protected] => 7401
    [trace:Exception:private] => Array
        (
            [0] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxServiceWrappers.php
                    [line] => 7401
                    [function] => __soapCall
                    [class] => SoapClient
                    [type] => ->
                    [args] => Array
                        (
                            [0] => IProgress_waitForCompletion
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [_this] => 52d3c8fb46611482-0000000000000005
                                            [timeout] => -1
                                        )

                                )

                        )

                )

            [1] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxconnector.php
                    [line] => 1065
                    [function] => waitForCompletion
                    [class] => IProgress
                    [type] => ->
                    [args] => Array
                        (
                            [0] => -1
                        )

                )

            [2] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/lib/vboxconnector.php
                    [line] => 951
                    [function] => remote_fileExists
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => Array
                                (
                                    [file] => /home/vbox/.VirtualBox/Machines/test/test.vdi
                                )

                        )

                )

            [3] => Array
                (
                    [file] => /var/www/d3xbucharest.go.ro/htdocs/phpvirtualbox/endpoints/api.php
                    [line] => 316
                    [function] => __call
                    [class] => vboxconnector
                    [type] => ->
                    [args] => Array
                        (
                            [0] => fileExists
                            [1] => Array
                                (
                                    [0] => Array
                                        (
                                            [file] => /home/vbox/.VirtualBox/Machines/test/test.vdi
                                        )

                                    [1] => Array
                                        (
                                            [0] => Array
                                                (
                                                    [data] => Array
                                                        (
                                                            [responseData] => Array
                                                                (
                                                                )

                                                        )

                                                    [errors] => Array
                                                        (
                                                        )

                                                    [persist] => Array
                                                        (
                                                        )

                                                    [messages] => Array
                                                        (
                                                        )

                                                )

                                        )

                                )

                        )

                )

        )

    [previous:Exception:private] => 
    [faultstring] => VirtualBox error: rc=0x80004004
    [faultcode] => SOAP-ENV:Client
    [detail] => stdClass Object
        (
            [RuntimeFault] => stdClass Object
                (
                    [resultCode] => -2147467260
                    [returnval] => 
                )

        )

)

Trying to click create again just stays in "loading". All I can do is refresh and reload the page and try again.

And that's about it. If I try to look at that file,

$ ls -la /home/vbox/.VirtualBox/Machines/
total 12
drwx------ 3 vbox vbox 4096 Mar 25  2017  .
drwx------ 3 vbox vbox 4096 Feb  9 11:52  ..
$ ls -la /home/vbox/.VirtualBox/Machines/test/test.vdi
ls: cannot access '/home/vbox/.VirtualBox/Machines/test/test.vdi': No such file or directory
@tom077
Copy link
Contributor

tom077 commented Feb 9, 2018

Hi,

Very strange issue :)

Is it happening once or repeatedly when you try to create a VM?
In what filesystem is /home/vbox/.VirtualBox/Machines?
Did you try to change your "Default Machine Folder"?
Don't you have an old "test.vdi" file registered in Virtual Media Manager/Hard Disks? Guess no if it's a fresh setup.
Can you post your config.php (with blanked password)?

@tom077
Copy link
Contributor

tom077 commented Feb 9, 2018

Just try to setup a Gentoo machine. It gave me headache and I'm a regular ArchLinux user which is considered as hard to setup. I give up sorry.

@d3xt3r01
Copy link
Author

d3xt3r01 commented Feb 10, 2018

I can even try to remove ~vbox/.VirtualBox/ and same will happen.
The filesystem is an ext4.
Change what where ?
Nope, like the ls command shows, there's no such file. I can try with any name.
Here's the config file:

<?php
class phpVBoxConfig {
var $username = 'vbox';
var $password = 'password'; // not the password
var $language = 'en';
var $vrdeports = '9000-9100';
var $maxProgressList = 5;
var $deleteOnRemove = true;
var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');
var $hostMemInfoRefreshInterval = 5;
var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');
var $consoleKeyboardLayout = 'EN';
var $nicMax = 4;
}

@d3xt3r01
Copy link
Author

d3xt3r01 commented Feb 11, 2018

Creating machines from the cli as the vbox user works just fine though...

 $ find ~/.VirtualBox/Machines/
/home/vbox/.VirtualBox/Machines/
$  VBoxManage createvm --name "test" --ostype Debian --register
Type Manifest File: /home/vbox/.VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
Virtual machine 'test' is created and registered.
UUID: 4e5457da-1921-4674-9a3b-28a7889e32f4
Settings file: '/home/vbox/.VirtualBox/Machines/test/test.vbox'
ipcDConnectService Stats
 => number of worker threads: 1
$  VBoxManage modifyvm test --memory 1024
Type Manifest File: /home/vbox/.VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
ipcDConnectService Stats
 => number of worker threads: 1
$ VBoxManage createmedium disk --filename /home/vbox/.VirtualBox/Machines/test/test.vdi --size 8192
Type Manifest File: /home/vbox/.VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Medium created. UUID: f7bc109a-68c3-48fb-91ac-5814801d1a70
ipcDConnectService Stats
 => number of worker threads: 1
 $ VBoxManage storagectl test --name disk --add sata
Type Manifest File: /home/vbox/.VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
ipcDConnectService Stats
 => number of worker threads: 1
$ VBoxManage storageattach test --storagectl disk --type hdd --medium /home/vbox/.VirtualBox/Machines/test/test.vdi --port 0
Type Manifest File: /home/vbox/.VirtualBox/xpti.dat
nsNativeComponentLoader: autoregistering begins.
nsNativeComponentLoader: autoregistering succeeded
nNCL: registering deferred (0)
ipcDConnectService Stats
 => number of worker threads: 1
 $ find ~/.VirtualBox/Machines/
/home/vbox/.VirtualBox/Machines/
/home/vbox/.VirtualBox/Machines/test
/home/vbox/.VirtualBox/Machines/test/test.vbox-prev
/home/vbox/.VirtualBox/Machines/test/test.vbox
/home/vbox/.VirtualBox/Machines/test/test.vdi

@d3xt3r01
Copy link
Author

Created an issue at the virtualbox guys too .. https://www.virtualbox.org/ticket/17899

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants