Oracle Virtual Box failing to open - virtualbox

I was trying to run Oracle Virtualbox Manager but it is not working. I am getting the following error message:
Failed to open a session for the virtual machine Oracle DB Developer VM.
The virtual machine 'Oracle DB Developer VM' has terminated unexpectedly during startup with exit code 1 (0x1). More details may be available in 'C:\Users\Ornob\VirtualBox VMs\Oracle DB Developer VM\Logs\VBoxHardening.log'.
Result Code: E_FAIL (0x80004005)
Component: MachineWrap
Interface: IMachine {b2547866-a0a1-4391-8b86-6952d82efaa0}
How do I fix this issue ?

I started virtual box in administrator mode, now it's able to start my VM

The error message indicates that the image is inaccessible, this may be due to several reasons but in most cases, the image has been moved to another directory by making a cut paste from the Windows Explorer.
go to the "Machine Manager" and click on "File".
Click on "Media Manager".
In the first tab called "Hard Drives", click on the image that is unreachable then click on the "Release" button to remove the disk link (UUID) to the VM.
Now click the "Delete" button to remove the disk from the "Virtual Media Manager".
Now all you have to do is add your image from the storage section and start on your virtual machine.

FWIW mine was a permission problem (ubuntu box). Looked in /var/log/syslogs and found :
Mar 23 14:54:54 xxxx update-notifier.desktop[2988]: ERROR: AssertionError("cannot parse ProcMaps line: Error: [Errno 13] Permission denied: 'maps'"
...
dlopen("/usr/lib/virtualbox/VBoxRT.so",) failed:
Have a look at permissions in /usr, /usr/lib, /usr/lib/virtualbox
These should all be owned by root.root, in my case /usr/lib was owned by another user.

Navigate to C:\Program Files\Oracle\VirtualBox\drivers\vboxdrv
Right click on VBoxDrv.inf file and select Install option
Restart VBox as administrator

Related

Google Cloud Compute Engine: sudo broke after "dnf upgrade" on Centos 8

the company i'm working with is developing a web application based on Laravel Framework, using Google Cloud Platform infrastructures. The frontend VM is a Centos8 OS with Apache webserver installed.
Seems that a developer ran a pretty massive "dnf upgrade" which included: kernel, openssl ,kerberos and others packages.
After the upgrade, seems that ldconfig has lost his mind:
[developer#webserver ~]$ sudo su - root
sudo: error in /etc/sudo.conf, line 19 while loading plugin "sudoers_policy"
sudo: unable to load /usr/libexec/sudo/sudoers.so: /lib64/libldap-2.4.so.2: undefined symbol: EVP_md4, version OPENSSL_1_1_0
sudo: fatal error, unable to load plugins
same for other commands like "dnf" or "rpm":
[developer#webserver ~]$ rpm
rpm: symbol lookup error: /lib64/librpmio.so.8: undefined symbol: EVP_md2, version OPENSSL_1_1_0
after a little bit of investigations, i found that the same commands, specifing the LD_LIBRARY_PATH variable, are working:
[developer#webserver ~]$ LD_LIBRARY_PATH=/lib64 rpm
RPM version 4.14.3
Copyright (C) 1998-2002 - Red Hat, Inc.
This program may be freely redistributed under the terms of the GNU GPL
...
...of course, i can't do the same trick with "sudo" command.
Important fact is that the VM is still running and it was never rebooted ( i'll exaplin later why i'm sayin this )
( and finally..at the point )
The major problem is that we can't use root account cause "sudo" is not working and, by default, Google use Public Key Authentication as deafult method (Local users has random passwords genereated by GCP). So actually, i can't even do a "dnf reinstall" to try fix the issues
I was afraid that, once rebooted, every services stops to work because of the incorrect dependecies library path, so instead of doing a reboot, i have created an image based on the VM and then a new VM based on that image.
As i was thinking: Once booted the new VM, every services stopped working. i was able to read the logs over the serial console of GCP web interface.
a snippet:
...
Oct 27 20:20:30 webserver google_oslogin_nss_cache[783]: /usr/bin/google_oslogin_nss_cache: /lib64/libjson-c.so.4: no version information available (required by /usr/bin/google_oslogin_nss_cache)
Oct 27 20:20:30 webserver NetworkManager[778]: /usr/sbin/NetworkManager: symbol lookup error: /lib64/libldap-2.4.so.2: undefined symbol: EVP_md4, version OPENSSL_1_1_0
Oct 27 20:20:30 webserver google_oslogin_nss_cache[783]: /usr/bin/google_oslogin_nss_cache: symbol lookup error: /lib64/libldap-2.4.so.2: undefined symbol: EVP_md4, version OPENSSL_1_1_0
Oct 27 20:20:30 webserver sssd[771]: ldb: unable to dlopen /usr/lib64/ldb/modules/ldb/ldap.so : /lib64/libldap-2.4.so.2: undefined symbol: EVP_md4, version OPENSSL_1_1_0
...
Using Google official documentation, i found the "startup-script" section of the VM properties that can be launched at every boot and that can be used to "change" user's passwords.
I know that, by default, all VMs has root access disabled, so i made this and added to vm's "automation" script:
#! /bin/bash
echo 'developer:PASSWORD' | chpasswd
echo 'root:PASSWORD' | chpasswd
Once rebooted, i've tried to login using the "serial console" option on the web interface, but with no luck. I've also used journalctl ( as normal user ) to find something in the logs... but nothing.
i suppose that is a consequence of that "google_oslogin_nss_cache" error
there's no way to run that script.
Searching on the internet, i've found some posts where someone was able to login directly as "root" using the "gcloud compute ssh" command. So i have tried to login as described using another VM of the same project, using both my google account user and root user...but also in this way ...no luck.
( i forgot to mention that my google account has "project owner" role, so actually i have all necessary permissions )
is there another way to reset "root" password without using "sudo" or i have to reinstall the VM from start?
I'm sorry for the long explanation....hope that everything is clear
Thanks
So... actually this question is divided by 2 different issues:
The only possible way for me to recover "root" account was to stop the VM, detach the boot disk, mount the boot disk on a new VM, mount the filesystem and modify the user. once boot disk is reattached to the original VM..you can use the modified account
second issue was made by upgrading openssl...so in the end the only way to avoid that error messages was to create a new file: /etc/ld.so.conf.d/libc.conf:
/usr/lib64

amazon-ssm-agent failing to restart after reboot on Windows Server 2019 instance

We are applying patches to our Windows instances using the patch manager function in AWS Systems Manager. We have a patch baseline that is executed against a set of windows instances (each of which are part of a patch group) by executing a maintenance window which in turn executes a run command against each of the instances. However we are finding the following:
The instances in question seem to get patches installed correctly. Executing wmic qfe list shows that the patches have been installed on the target machines
The target instances are then rebooted after patches are installed
The run command remains in progress indefinitely
From more investigation we found that the amazon-ssh-agent failed to start when the instances are rebooted. The error logs were as follows:
[devInstanceA]: PS C:\ProgramData\Amazon\SSM\Logs> get-content .\errors.log -tail 20
2020-11-09 09:36:02 ERROR [func1 # coremanager.go.246] [instanceID=i-04b3ce4e6e53b0b6f] error occurred trying to start core module. Plugin name: StartupProcessor. Error: Internal error occurred by startup processor: runtime error: invalid memory address or nil pointer dereference
Once we manually restarted the amazon-ssh-agent again the run command completed successfully. This issue is we dont want to have to manually start the amazon-ssh-agenton each instance especially as we have alot of instances!
Any ideas on what is causing this, i.e. why is the amazon-ssh-agent not starting up successfully after automatic reboot?

\[INS-30014] Unable to check whether the location specified is on CFS

On migrating my local Oracle DB on Windows, from 11g to 19c, while running the setup.exe, I got a:
[INS-30014] Unable to check whether the location specified is on CFS
In my case, I needed to open my hosts file (C:\Windows\System32\drivers\etc\hosts) and comment out the following:
# 192.168.0.111 host.docker.internal
# 192.168.0.111 gateway.docker.internal
# 127.0.0.1 kubernetes.docker.internal
These seemed to be remnants of my old docker installation which has since been removed.
In my case this was a permissions issue on the Oracle Home directory. If your Windows PC name is >= 16 characters in length, the name of the administrators group is affected, because only the first 15 characters are included. The mismatch between that first part of the name and the full name is what was causing the issue. DESKTOP-ASUS-ROG vs. DESKTOP-ASUS-RO in my case (notice the missing G). I renamed the PC to DESKTOPASUS, restarted the machine, and it worked without issue. The name discrepancy was apparent when looking at the security configuration of the folder when my system name was over max.
You can get your PC name by running hostname from the command line. If it's >= 16 characters, rename the PC to be <= 15 characters, and restart.
The underlying issue is indirectly discussed here in a different context:
https://learn.microsoft.com/en-us/troubleshoot/windows-server/identity/naming-conventions-for-computer-domain-site-ou
Maximum name length: 15 characters.
I tried other solutions from Stackoverflow, but none worked in my case.
Here is the fix:
Go to Control Panel > Network and Internet > Network Connections
Disable
vEthernet (Docker)
vEthernet (Default switch)
resume the install
re-enable both disabled vEthernet.
By installing the software first and then running dbca to create the db I got it to work,
Execute hostname in command prompt
Add the hostname returned by hostname command next to IP address in windows hosts file. Also add the hostname with domain name next to it
9.115.154.54 LP1-AP-WIN73 LP1-AP-WIN73.yourdomain.com
Save hosts file and resume install
INS-30014: Unable to check whether the location specified is on CFS
Cause: The location specified might not have the required permissions.
Action: Provide a location which has the appropriate required permissions.
During installation of oracle 21c enterprise,
I got:
INS-30014: Unable to check whether the location specified is on CFS
In may case, in environment variable, I remove all unwanted path of oracle, which are not useful. And its work fine for me.
I faced this issue when I tried installing Oracle 19c on my Windows 10, I just disconnected from the internet(WiFi), and then the issue got disappeared.
While installing oracle 19 c I was faced with the INS-30014: Unable to check whether the location specified is on CFS
On windows 11 I was able to solve the error by connecting to the internet

Qt: launch a message box periodically with crontab in ubuntu

I am trying to launch a Qt message box every minute. I added a line in crontab to run the Qt program's executable and redirected the error output to a file in my home directory.
There is no problem with the Qt program that launches the message box because I tested it, but when I try to launch it with crontab the following error arises:
QXcbConnection: Could not connect to display
Aborted (core dumped)
I checked that over the internet and found a thread that might be helpful: https://unix.stackexchange.com/questions/148945/could-not-connect-to-display-in-one-user-account/149026#149026
I believe the first response gives the solution but it's not clear.
It suggests to use x11 to share the desktop and xauth to add security measures but doesn't specify how to configure them. I have xauth already installed but the error persists.
Any ideas about how to solve this problem?
I think the DISPLAY environment is missing. I suggest you wrap your application in a wrapper script (let's call it horloge.sh):
#!/bin/sh
DISPLAY=:0
export DISPLAY
/home/salwa/computing/cpp/horloge
Then put the horloge.sh in your crontab. Don't forget to do a chmod u+x horloge.sh so that the script is executable.
Make sure that the user that launches your app in the crontab line is you. Otherwise, it may not have permissions to use the X server.

Why could VirtualBox not find a registered machine named Windows_7?

I'm trying to change TCP/UDP of a virtual machine using VBoxManage setextradata.
Whenever I type the command:
sudo VBoxManage setextradata Windows_7 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestEmule_TCP/Protocol" TCP
I get the following error:
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
[!] FAILED calling a->virtualBox->FindMachine(Bstr(a->argv[0]), machine.asOutParam()) at line 3688!
[!] Primary RC = VBOX_E_OBJECT_NOT_FOUND (0x80BB0001) - Object corresponding to the supplied arguments does not exist
[!] Full error info present: true , basic error info present: true
[!] Result Code = VBOX_E_OBJECT_NOT_FOUND (0x80BB0001) - Object corresponding to the supplied arguments does not exist
[!] Text = Could not find a registered machine named 'Windows_7'
[!] Component = VirtualBox, Interface: IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
[!] Callee = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
The virtual-machine has been created using GUI. Any idea?
$ cd /Users/marco/Library/VirtualBox/Machines/Windows_7
$ ls
Logs Windows_7.xml
Windows 7.xml.1.5-macosx.bak
$ sudo vboxmanage registervm Windows_7.xml
VirtualBox Command Line Management Interface Version 2.1.4
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.
[!] FAILED calling a->virtualBox->OpenMachine(Bstr(a->argv[0]), machine.asOutParam()) at line 762!
[!] Primary RC = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Full error info present: true , basic error info present: true
[!] Result Code = NS_ERROR_FAILURE (0x80004005) - Operation failed
[!] Text = Could not lock the settings file '/var/root/Library/VirtualBox/Windows_7.xml' (VERR_FILE_NOT_FOUND)
[!] Component = Machine, Interface: IMachine, {ea6fb7ea-1993-4642-b113-f29eb39e0df0}
[!] Callee = IVirtualBox, {339abca2-f47a-4302-87f5-7bc324e6bbde}
It fails because you are using sudo. VirtualBox is designed to be run by any user (in the vboxusers group), and sudo runs the command as the root user whose VirtualBox configuration is empty.
You can check that by typing:
sudo VBoxManage -nologo list vms # Should print only a newline
VBoxManage -nologo list vms # Detailled information about all your VMs
!! WINDOWS ONLY!!
If you are not on an admin account and are trying to modify your VM in a administrator cmd window, type these commands:
cd "C:\Program Files\Oracle\VirtualBox"
VboxManage registervm "C:\Users\Your Name Here\VirtualBox VMs\Your VM name here\Your VM name here.vbox"
Now run your virtual box modify commands or what ever else you are doing and it should work!
Not a direct answer, but just to put it out there for other people searching for it:
On Mac OS X, you can tell VirtualBox to load VMs from another user's home directory, provided the file permissions allow it, or if you are running VirtualBox as the root user using sudo (e.g. if you absolutely have to access your host's web server on port 80).
The way to do this is to set VBOX_USER_HOME appropriately, e.g.
VBOX_USER_HOME=/Users/the_other_user/Library/VirtualBox
If you want to run VBoxHeadless under root, use:
sudo VBOX_USER_HOME=/Users/your_user_id/Library/VirtualBox nohup \
VBoxHeadless -s "IE10 - Win7" </dev/null &>/dev/null &
I had a similar error message, whenever I used sudo to start VBoxSDL:
Error: machine with the given name not found!
Check if this VM has been corrupted and is now inaccessible.
And similar to ypocat's answer, I solved it for Ubuntu using a small script like this:
#!/bin/bash
export VBOX_USER_HOME=/home/username/.config/VirtualBox
VBoxSDL --startvm nameOfVM
You can use it whenever you need to start your VM as root.
SOLUTION_1:
Missing Virtual Technology might be the reason. For Intel systems they have Intel VT-x (for AMD they have AMD-V), so make sure it is enabled. You can enable it in the boot screen go to BIOS Setup in that look for System Configuration tab and enable Virtual Technology
.
SOLUTION_2:
Open terminal or cmd (Run as admin) for Windows, and run SC START VBOXDRV. If it says the service is already running then try SC STOP VBOXDRV and then SC START VBOXDRV.
RealScar solution helped me in addition to other commands and it worked in Ubuntu 20.04, too.
I had the problem initially indicated (VirtualBox unable to find a registered machine). I was getting no results after typing sudo VBoxManage -nologo list vms, so I manually registered the existing machine typing sudo vboxmanage registervm /home/user/VirtualBox\ VMs/machinenamefolder/machinename.vbox. It worked great.
Note: I was creating a Cuckoo Malware Sandbox Analysis.
REASON: In the above case its uuid-mismatch (w.r.t. what is pointed to what is generated). Typically case of either improper edit of the vbox config files or accidentally deleted images/configs associated.
SOLUTION:
As FIRST Step: Correct the UUID-Mappings;
So, for example, the uuids can be regenerated to correct the mappings. (1)
Or otherwise, if attempted to edit .vbox/.vmdk/VirtualBox.xml files, the mappings should be corrected. (2)
As SECOND Step: Re-register the virtual-machine to the UI.
For example, if can't open the vm's from vbox gui or terminal. Remove the "inaccessible" entry from the GUI first". And then, open the folder of virtual machine and open file <machine name>.vbox with virtualbox and it will get registered. Provided, the uuid-mappings have been already resolved. Else follow the errors, while you attempt to register to make necessary changes in .vbox file.