Virtualbox fail to start a virtual machine - linux

Virtualbox gives me the following output:
Failed to open a session for the virtual machine 8.
The VM session was closed before any attempt to power it on.
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: SessionMachine
Interface: ISession {7844aa05-b02e-4cdd-a04f-ade4a762e6b7}
Edit: The option "Discard Saved States" is disabled.

Try this:
cd /home/$user/.VirtualBox/
find the VirtualBox.xml-prev, which is a backup of the previous Virtual Box config
3.remove he current non-working config file
rm VirtualBox.xml
Use the previous working config file
mv VirtualBox.xml-prev VirtualBox.xml
Source:
https://askubuntu.com/questions/217972/virtualbox-does-not-run-ns-error-failure

Solved!
I imported the virtual machine from a previous backup when I wiped the system clean. First I found out that the usb 2.0 configs were conflicting with virtualbox and after solving it I was prompted to install the Extension Pack.
Done!
May the force be with you.

Related

Virtual-box failed to start VM VERR_INTNET_FLT_IF_NOT_FOUND

When I run vagrant up I get this error
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "3ae7b70c-8ea1-417a-ab67-99aef96624f8", "--type", "headless"]
Stderr: VBoxManage.exe: error: Failed to open/create the internal network 'HostInterfaceNetworking-VirtualBox Host-Only Ethernet Adapter #2' (VERR_INTNET_FLT_IF_NOT_FOUND).
VBoxManage.exe: error: Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
I found the solution here: https://www.howtoforge.com/setup-a-local-wordpress-development-environment-with-vagrant/ which is to update the driver of VirtualBox Host-Only Ethernet Adapter
But the problem is I am remotely connected to the machine. So I am afraid that the network settings may lose my remote connection. Also, I cannot reboot the machine.
Is it safe to follow the steps mentioned in the link above which should not disconnect me? If not, is there any alternative way?
Recently I have struggled with this issue. I tried many times to solve the issue. Sometimes I was able to run my vagrant machines successfully but how I did was not sure because I was trying lot of options. But finally, I found a way to solve it. It's pretty simple and tricky.
Solution:
Once you get this error on your terminal, just open your computer network adaptors from the control panel. Select the adaptor which was created for that virtual box. simply disable once and enable again. then run vagrant up command. That's it. the problem is gone.
- Start --> Network status --> Change adaptor options --> (select the Ethernet adaptor - In my case it is Ethernet4)
- Right click --> Disable and right click --> Enable
- vagrant up
I faced the same issue and could not resolve it by changing properties in Network Adapters.
Then i reinstalled Virtual Machine by below command and it worked fine:
V:\softwares>VirtualBox-6.0.4-128413-Win.exe -msiparams NETWORKTYPE=NDIS5

Can you help me access Mac SMB share from Ubuntu using smbclient? (NT_STATUS_ACCESS_DENIED error)

I've been working on a file server product that uses smbcilent to transfer files between client computers and the server. It's been working great so far with our LAMP (Ubuntu) server and Windows machines.
I'm currently trying to expand the setup to include Mac's, but am having trouble with the server accessing the share on the Mac.
Here's my command and error (bracketed descriptions replace private info):
# smbclient //10.101.0.7/[share-file] -U [username]%[password] -c ls
WARNING: The "syslog" option is deprecated
NTLMSSP packet check failed due to short signature (0 bytes)!
NTLMSSP NTLM2 packet check failed due to invalid signature!
session setup failed: NT_STATUS_ACCESS_DENIED
Things I've tried:
✓ Accessing share using a Windows machine to ensure the share is setup properly - check! Works fine there.
✓ Invoking -S off or --signing=off in the command - no change.
✓ Just looking at the shares first using smbclient -L 10.101.0.7 -U [username]%[password] - same error.
✓ Googling for an answer - check! Several people with similar problems, but no working solutions so far.
The most promising thing I've see so far involves compiling smbclient 4.4 from sources and running that with no authentication (-U ""%""), but that seems like a temporary solution based on a bug rather than a solid plan that will work for a long time. (But I'll try that next if I can't find any better ideas...)
Thanks for reading and trying to help!
Try adding --option="ntlmssp_client:force_old_spnego = yes" to the smbclient command as suggested on the samba-technical mailing list.
For me, this now lists shares on a Mac OSX server:
smbclient -U$user%$password -L $mac_host --option="ntlmssp_client:force_old_spnego = yes"
For mounting, you may need to add the nounix,sec=ntlmssp options as in
sudo mount -t cifs //$mac_host/$share $mountpoint -o nounix,sec=ntlmssp,username=$user,password=$password
On recent versions of MacOS (e.g. Monterey) it is necessary to do several configuration steps to enable smb access from Linux:
Open System Preferences.
Select Sharing.
Select File Sharing.
Ensure that the directory is listed in Shared Folders.
Right-click/two-finger click on the share directory.
Click on Advanced Options
Ensure Only allow SMB encrypted connections is checked.
Click OK
Click on Options
Click on the checkbox for Share files and folders using SMB.
Under Windows File Sharing ensure the appropriate user is checked.
Type the user's password in the 'Authenticate' dialog bo and press 'OK'.
Click 'Done'.
You should now be able to connect from Linux to the MacOS share using the commands given by #mivk.

How to handle files in case-sensitive way in Vagrant on Windows host

On My Windows 8 I've installed VirtualBox + Vagrant. I used Laravel Homestead (with Ubuntu) as box. When running site on this VM or running command line I would expect it is being run on Linux and not on Windows. But I found some strange issue:
First my folder mappings:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
sites:
- map: learn.app
to: /home/vagrant/code/my-first-app/public
When I run in my browser http://learn.app:8000 I got correct output - page from /home/vagrant/code/my-first-app/public what is the same as code from D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony\my-first-app/public just to be clear.
Now the problem:
In my public folder I've created 2 simple files:
File with name test (it's empty) and file index.php with content:
<?php
if (file_exists('TEST')) {
echo "file exists";
}
else {
echo "file NOT exists";
}
So now I run http://learn.app:8000 in browser and I get output file exists. This is the result I wouldn't expect. As far as I know in Linux (my box is Ubuntu) you may have files with different case in names (in opposite to Windows) so I would expect I got file NOT exists.
I've tested it in my VM running php index.php and I get exact same result file exists what is again unexpected.
Now what I did I copied those 2 files to other directory on my VM /home/vagrant/TESTS - this directory is not mapped using Vagrant. Now when I run php index.php I get file NOT exists what is expected result.
To be honest I completely doesn't understand it. Question - does PHP when using Vagrant mapping operating on VM filesystem (in this case Ubuntu) or on Virtual BOX host filesystem (in my case Windows). Is there any way to make it work to get desired result? I know this question might be a bit software related but it's really connected to PHP and Laravel and maybe I miss something here.
I think this issue can be solved not using Samba or too much work.
In Windows cmd I run:
vagrant plugin install vagrant-winnfsd
It installed a plugin for NFS for Windows although at http://docs.vagrantup.com/v2/synced-folders/nfs.html you have clear info that NFS doesn't work for Windows:
Windows users: NFS folders do not work on Windows hosts. Vagrant will ignore your request for NFS synced folders on Windows.
I modified my Homestead.yaml file mapping from:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
to:
folders:
- map: D:\DaneAplikacji\easyphp\data\localweb\projects\testprovag\strony
to: /home/vagrant/code
type: "nfs"
(probably if not using Homestead.yaml you can add type: nfs, something like that: config.vm.synced_folder ".", "/vagrant", type: "nfs" in your Vagrantfile)
Now when I run
vagrant up
I got 2 or 3 notices for admin password (probably some Windows configuration of NFS - it will appear only when I run vagrant up first after adding NFS type) but now both for using url http://learn.app:8000 I got for the case from question file NOT exists and the same when I run php index.php in box commandline.
Note: this solution doesn't make you can create test and TEST files in the same directory and you will have them in your file system. It seems to handle file in case sensitive way, so if you create a file in wrong case in your app (and later in your code you want to load it/require) you will notice that it doesn't work on your Vagrant Linux box (and it would work on Windows WAMP and you would be suprised when moving on production).
With the default vagrant share that you use the mounted folder still provided by the underlying file system. It won't handle linux ACLs properly either.
One solution we found for this is instead of sharing the host's folder with the client, we set up samba on the guest and shared it back to the host. It's more cumbersome and you have to do more configuration but at least you app runs in an environment as it should be
Interesting. I use Windows 7 with Homestead - and I also assumed that the case sensitivity file issue would be handled by Vagrant. But I ran some similar tests - and you are correct - it is actually case insensitive.
I can confirm the issue is not to do with PHP at all - the issue actually occurs inside Vagrant on the command line itself:
touch EXAMPLE
rm example
That passes on the Vagrant box when I am SSH into it. But on a real Ubuntu box (I tested it on my server) - that command fails.
The reason is that Vagrant is calling to Windows to check if the file exists for the mapped folders. But if you make a virtual non-mapped folder inside of Vagrant - then the 'call' to see if the file exists remains inside of Vagrant and thus handled only by Ubuntu - and that is why your other test passed.
I tried turning on Case Sensitivity for Windows 7 as documented here - but it didnt solve the problem

How to change the host name of the ubuntu server running oracle xe

I have a oracle 11g XE instance running under ubuntu server. I tried changing the hostname of the server by modifying the host name in /etc/hostname, /etc/hosts, tnsnames.ora and listener.ora but the oracle-xe instance fails to start after reboot. Any idea which configuration I am missing?
Sometimes Oracle starts with only certain services / functionalities not working properly... If that's the case and your Oracle instance partially failed to start you can get some more information about running listeners by invoking the lsnrctl command line utility and then using the status command.
You can also look for clues in the Oracle log files under <oracle-install>/app/oracle/diag/tnslsnr/<hostname>/listener/alert/log.xml - you should definitely have one for your old hostname and you might have another one created for your new hostname as well.
I had this and solved it just rename your listner.ora and restart, it will change the setting for the new host name
see my explanation Here

Cygwin home directory on target system inconsistent

I am having difficulty connecting to a remote Windows system running cygwin.
When I connect from a linux box to cygwin, it connects fine and "sees" the
remote home directory as /home/userID
When I connect from Windows cygwin to the remote windows cygwin, it sees
the home directory as /cygdrive/c/Documents and Settings/UserID
Finally, when I am logged onto the remote Windows machine (the one with the problem)
home is /home/UseID but the value for cygpath -H is
$ echo $(cygpath -H)
/cygdrive/c/Documents and Settings
This seems to be causing my connection problem from windows to windows
and no problem from linux to windows
Any ideas how to fix it?
Since you have the correct path in /etc/passwd, one possibility is that perhaps the SSH client you are using from your Windows systems is sending custom environment values.
If you're using PuTTY, before connecting, look in the tree panel on the left hand side of the dialog. There should be an entry called Connection and a sub-entry called Data which will bring you to an option screen that has a section called Environment variables. Check if the HOME var is being overridden there and if so, remove it.
If you're using a different SSH client, check its configuration to see if its using the SendEnv option. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config.
Or you could try blocking off custom environments on the destination/server side by disabling AcceptEnv in the SSHd configuration on the system you're connecting to. More info on that here: http://www.openbsd.org/cgi-bin/man.cgi?query=sshd_config.
Hope this helps.

Resources