13

I have installed Jenkins(version 2.74) and installed vagrant plugin. Created a job which creates a vagrantfile and executes vagrant box add command

vagrant box add test solaris.box

and executed vagrant up command and VM is running successfully in jenkins job.

But VM is not displaying in VirtualBox Manager.

In command prompt, VBoxManage.exe list vms command also not listing the running VM name.

Vagrant Version : 1.7.4 VirtualBox Version : 5.0.12

Command Prompt Output :

D:\>vagrant global-status
id       name    provider   state   directory
------------------------------------------------------------------------
ee544e4  default virtualbox running D:/nBOL_VMS/nbolapp
67df2d1  default virtualbox running D:/nBOL_VMS/nbolapptest
206a5c8  default virtualbox running D:/nBOL_VMS/Jenkins-slave


VBoxManage.exe list runningvms

Here my command prompt output shows null when i execute VBoxManage.exe list runningvms.

Jenkins Output:

Vagrant global Status : 
id       name    provider   state   directory                           
------------------------------------------------------------------------
ee544e4  default virtualbox running D:/nBOL_VMS/nbolapp                 
67df2d1  default virtualbox running D:/nBOL_VMS/nbolapptest             
206a5c8  default virtualbox running D:/nBOL_VMS/Jenkins-slave

VBoxManage list runningvms
"nbolapptest" {bc04dd64-c868-4304-a3b7-eff6d66f862e}
"Jenkins-slave" {c73ead23-ecd7-499d-b5b9-2d52c3b49d7e}
"nbolapp" {4c762312-013e-4ae7-9649-8239abe0f92d}

VBoxManage showvminfo bc04dd64-c868-4304-a3b7-eff6d66f862e
Name:            nbolapptest
Groups:          /
Guest OS:        Oracle Solaris 11 (64-bit)
UUID:            bc04dd64-c868-4304-a3b7-eff6d66f862e
Config file:     C:\Users\sbsa\VirtualBox VMs\nbolapptest\nbolapptest.vbox
Snapshot folder: C:\Users\sbsa\VirtualBox VMs\nbolapptest\Snapshots
Log folder:      C:\Users\sbsa\VirtualBox VMs\nbolapptest\Logs
Hardware UUID:   bc04dd64-c868-4304-a3b7-eff6d66f862e
Memory size:     8192MB
Page Fusion:     off
VRAM size:       12MB
CPU exec cap:    100%
HPET:            off
Chipset:         piix3
Firmware:        BIOS
Number of CPUs:  2
PAE:             off
Long Mode:       on
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode:  message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI:            on
IOAPIC:          on
Time offset:     0ms
RTC:             UTC
Hardw. virt.ext: on
Nested Paging:   on
Large Pages:     on
VT-x VPID:       on
VT-x unr. exec.: on
Paravirt. Provider: Default
State:           running (since 2016-11-07T11:40:20.291000000)
Monitor count:   1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address: 
Teleporter Password: 
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration: 
Autostart Enabled: off
Autostart Delay: 0
Default Frontend: 
Storage Controller Name (0):            SATA
Storage Controller Type (0):            IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  30
Storage Controller Port Count (0):      2
Storage Controller Bootable (0):        on
SATA (0, 0): C:\Users\sbsa\VirtualBox VMs\nbolapptest\box-disk1.vmdk (UUID: 03b32e37-f77c-456c-a4e9-fe6753d87761)
SATA (1, 0): Empty
NIC 1:           MAC: 080027015DD9, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0):   name = ssh, protocol = tcp, host ip = 127.0.0.1, host port = 2222, guest ip = , guest port = 22
NIC 1 Rule(1):   name = tcp1521, protocol = tcp, host ip = , host port = 1521, guest ip = , guest port = 1521
NIC 1 Rule(2):   name = tcp6000, protocol = tcp, host ip = , host port = 6000, guest ip = , guest port = 6000
NIC 1 Rule(3):   name = tcp8080, protocol = tcp, host ip = , host port = 2200, guest ip = , guest port = 8080
NIC 1 Rule(4):   name = tcp9043, protocol = tcp, host ip = , host port = 9043, guest ip = , guest port = 9043
NIC 1 Rule(5):   name = tcp9060, protocol = tcp, host ip = , host port = 9060, guest ip = , guest port = 9060
NIC 1 Rule(6):   name = tcp9443, protocol = tcp, host ip = , host port = 9443, guest ip = , guest port = 9443
NIC 2:           MAC: 0800272C9857, Attachment: Bridged Interface 'Intel(R) Ethernet Connection (2) I219-LM', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 3:           disabled
NIC 4:           disabled
NIC 5:           disabled
NIC 6:           disabled
NIC 7:           disabled
NIC 8:           disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1:          disabled
UART 2:          disabled
LPT 1:           disabled
LPT 2:           disabled
Audio:           enabled (Driver: DSOUND, Controller: AC97, Codec: STAC9700)
Clipboard Mode:  disabled
Drag and drop Mode: disabled
Session name:    headless
Video mode:      1024x768x32 at 0,0 enabled
VRDE:            disabled
USB:             enabled
EHCI:            disabled
XHCI:            disabled

USB Device Filters:

<none>

Available remote USB devices:

<none>

Currently Attached USB Devices:

<none>

Bandwidth groups:  <none>

Shared folders:  

Name: 'vagrant', Host path: 'D:/nBOL_VMS/nbolapptest' (machine mapping), writable

VRDE Connection:    not active
Clients so far:     0

Video capturing:    not active
Capture screens:    0
Capture file:       C:\Users\sbsa\VirtualBox VMs\nbolapptest\nbolapptest.webm
Capture dimensions: 1024x768
Capture rate:       512 kbps
Capture FPS:        25

Guest:

Configured memory balloon size:      0 MB
OS type:                             Solaris_64
Additions run level:                 2
Additions version:                   4.3.18 r96516


Guest Facilities:

Facility "VirtualBox Base Driver": active/running (last update: 2016/11/07 11:41:19 UTC)
Facility "VirtualBox System Service": active/running (last update: 2016/11/07 11:41:47 UTC)
Facility "Seamless Mode": not active (last update: 2016/11/07 11:41:19 UTC)
Facility "Graphics Mode": not active (last update: 2016/11/07 11:41:19 UTC)

It shows all the details when above commands executed through jenkins job. What will be the issue.

user2439278
  • 1,222
  • 7
  • 41
  • 75
  • Maybe because Jenkins runs as a different user? – StephenKing Nov 02 '16 at 10:43
  • Jenkins runs as a Administrator only. And we are using Administrator account only – user2439278 Nov 02 '16 at 11:03
  • could it be possible you have another virtual box running on your system ? start your VM and check the process running for virtual box to check where it comes from – Frederic Henri Nov 02 '16 at 15:53
  • The scenario is, we started one VM manually using vagrant command in terminal and it is displayed in VirtualBox Manager. Then with help of jenkins in different location we tried to start another VM, but the VM not displaying in VirtualBox Manager. We checked the Task manager and found that the virtualbox process are running corresponding to the VM started via jenkins. But it is not displayed in the VirtualBox Manager. – user2439278 Nov 03 '16 at 10:04
  • Now i have removed the VM manually from the VirtualBox GUI. Then triggered the jenkins job to create the Virtual Environment. Now it displays in VirtualBox GUI but showing wrong status – user2439278 Nov 04 '16 at 06:28
  • When i checked the the VboxSVC.log , found the error message as "This machine does not have any snapshots". How to fix it – user2439278 Nov 04 '16 at 07:44
  • if you run `vagrant global-status` does the VM appear in the list and with an id ? you can also get the full id from `.vagrant/machines/default/virtualbox/inde_uuid` and run `vboxmanage showvminfo ` see if something wrong – Frederic Henri Nov 08 '16 at 08:04
  • I have updated my question with output of vagrant global-status and vboxmanage showvminfo both via command prompt and Jenkins job. – user2439278 Nov 09 '16 at 11:21

7 Answers7

8

(For Windows) Try running the Virtual box as an administrator and see if the running VMs are visible now.

rahul
  • 552
  • 6
  • 11
6

Run virtual box as root:

sudo virtualbox

sunwarr10r
  • 4,420
  • 8
  • 54
  • 109
1

In Windows 10 Vagrant Box shows in the VirtualBox Manager only if both cmd (from where Vagrant is started) and VirtualBox Manager are launched as normal user or if both are launched as Administrator. If you start Vagrant from cmd launched as Administrator and VirtualBox Manager as normal user then Vagrant Box will not show in the VirtualBox Manager.

Chupo_cro
  • 698
  • 1
  • 7
  • 21
1

If you change the credentials with which VM Services starts and configure the user with the administrative privileges that you use to start VirtualBox Manager, it will work correctly.

0

I resolved this in Windows 10 by running my Powershell window that I ran the Vagrant commands in as Administrator. Once I did that, VirtualBox started showing the proper status even if it wasn't started as Administrator.

Taegost
  • 1,208
  • 1
  • 17
  • 26
0

you have to start virtualbox with su user# privilege or sudo virtualbox or login in ubuntu as root and it will work i had same issue first time but it is fixed that way

Tigran
  • 111
  • 1
  • 3
0

I am using Ubuntu 20.04.1 LTS. I had also faced the same error was unable to see my VM's created using vagrant.

$ sudo virtualbox

the command worked for me

Reason:- Because while I had created the VM's using vagrant I was logged in as a root user.

Prabhakaran
  • 3,900
  • 15
  • 46
  • 113