How to enable VT-x from linux command line - virtualbox

Is there a way to enable VT-x from linux (not Windows) command line without having to reboot and enter the BIOS? Would be very useful since I don't have access to the server to enter the BIOS GUI.

Both on Windows and Linux you can manage the VMs from the command line using VBoxManage tool as long as the Vt-d is enabled in the BIOS. I'm not clear on why the nested-VTX function in the VirtualBox VM parameter appears "uncheckable" or unavailable anyhow. I've found this command very handy for the case:
VBoxManage modifyvm [name_of_vm] --nested-hw-virt on

Related

How to solve 'VT-x is not available (VERR_VMX_NO_VMX)' error on Virtual box?

I installed Oracle VirtualBox v5.2.18 on my Windows 10 1803 and ran Ubuntu 18.04 on it, but it gave me this message: "VT-x is not available" (see image below):
VT-x is available on the CPU I'm using and is enabled in BIOS, also I've turned off Hyper-V using task manager.
What should I do next?
Thanks in advance
I had the same issue with Virtual Box. After trying to solve the problem for a while I decided to try VMWare Player. This also gave me an error, something with Device Guard being enabled. Then after some searching I came across this video: https://www.youtube.com/watch?v=VIBdY-5zr58
In short my problem was solved after entering the commands below in a administrator command prompt:
bcdedit /create {0cb3b571-2f2e-4343-a879-d86a476d7215} /d "DebugTool" /application osloader
Then copy paste the rest below and press enter
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} path "\EFI\Microsoft\Boot\SecConfig.efi"
bcdedit /set {bootmgr} bootsequence {0cb3b571-2f2e-4343-a879-d86a476d7215}
bcdedit /set {0cb3b571-2f2e-4343-a879-d86a476d7215} loadoptions DISABLE-LSA-ISO,DISABLE-VBS
bcdedit /set hypervisorlaunchtype off
Now, Restart your system
Both VMWare and Virtual box started working after the reboot on my machine.
Try this:
Uncheck Hyper-V via Control Panel/ Windows features on or off (reboot maschine)
Switch off Memory Integrity in Windows Defender Security Center / Equipment Safety (? translated by myself...)
I had the same issue and got it fixed by disabling Containers and Hyper-V features from Windows Features dialog
Windows Features Dialog
If you have uninstalled hyperv and ensured SVM, vt-x or whatever virtualization is available in your bios, then try this:
Run these commands in an elevated cmd prompt, then reboot
dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype off
FTR I do not recommend disabling windows defender integrity features.

VMWare Workstation won't suspend from command line

I'm trying to automate VMWare Desktop on Windows 7 to suspend all vm's before I do a backup job each night. I used to have a script that did this but I've noticed now that it won't suspend anymore with the same command that used to work.
If I do vmrun list I get a list of the running vms with no issue.
If I do vmrun suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" it just hangs and I have to kill the command with CTRL+C.
I've even tried a newer command using -T to specify it's workstation, ie vmrun -T ws suspend "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and still no love.
If I have the vm already stopped, I can issue vmrun start "V:\Virtual Machines\RICHARD-DEV\RICHARD-DEV.vmx" and it starts fine.
As well as the suspend command, the stop command also does not work. I'm running VMWare Workstation 11.1.3 build-3206955 on Windows 7.
Any ideas?
Update:
I installed latest VMWare Tools on the guest, as well as the latest Vix on the Host so everything should be up to date.
I can start a vm using vmrun with no problem using vmrun -T ws start <path to vmx> but the command doesn't come back to the command prompt, so I'm assuming it's not getting confirmation from the vm that it is now running.
If I cancel the 'start' command and now try and suspend I'm getting the same lack of communication from the guest. If I manually suspend the vm, once it's suspended I get an 'Error: vm is not running' and the 'suspend' command finally times out and comes back.
So, it looks to me like there is no communication from vmrun to the guest about what state it's in etc. Is there a way to debug the communication from the host to the guest using vmrun or other means? Are there ports I need open in the guest OS?
So, I never did get vmrun to work properly on my main system, although I did get it behave ok on my laptop so there is something weird happening on this machine. I also installed a trial of the latest VMWare 12 and the same thing happens.
As a workaround, I ended up changing the power management settings in my guest OS so that it would 'sleep' after 1 hr of inactivity. When this happens VMWare detects it and automatically suspends the guest which is really what I'm looking for. Not the most slick solution but it does manage to unlock the files I need to be backed up in a nightly backup.

Can I bring up the GUI for a Vagrant managed Virtual box while the box is running?

I know that I can configure my Vagrantfile to boot my machine with a GUI according to http://docs.vagrantup.com/v2/virtualbox/configuration.html with:
config.vm.provider "virtualbox" do |v|
v.gui = true
end
But if I've started a box headless, is there any way to bring up a GUI while the machine is running? Virtualbox provides the small preview, so I suspect it is possible but I haven't found any documentation on how to do this.
Edit: Terry pointed out that I can vagrant reload after changing the setting above to get a gui, but that reboots the box. I'm still hoping there's a easy way to enable the gui without a reboot.
There are 3 ways I've found to get a gui on a running headless machine if you can see it in the VirtualBox Manager:
You can suspend the machine (Close|Save State or vagrant suspend) and then start it again. When you restart it, you will see the GUI.
or, if you don't want to stop the machine at all:
You can go to display settings and enable the Remote Display Server while it's running (you may want to change the default port), and then use an RDP viewer (On Windows use Remote Desktop Connection) to access the GUI.
[Edit July 2015] With VirtualBox 5.0, click on the headless VM, choose "Show", and it will bring up the gui.
You'll have to do vagrant reload after enabling gui.
But there is a trick (a bit risky in my opinion)
1. save the state of the VM VBoxManage controlvm NAME_OR_UUID savestate
2. star vbox gui and resume
BTW: BTW: Why do you need GUI for Vagrant managed (headless) running VMs? If you prefer GUI to manage headless VMs, try phpVirtualBox.
From my experience with vagrant once you start completely headless there is no way to boot the GUI, you have to boot it on start with the line you mention above.
If it's running on VirtualBox (what vagrant typically uses) :
preface: you can't without (shortly) interrupting the VM! So you can't just open it for a running instance in VirtualBox.
You may find http://www.toptensoftware.com/VBoxHeadlessTray/ helpful, it has minor bugs if you ask me but nice to have to save what you can do ...
... On console: you might simply do what #terry-wang wrote:
suspend machine by VBoxManage controlvm <NAME_OR_UUID> savestate
restart with gui option VBoxManage startvm <NAME_OR_UUID> --type gui
alternative: start gui manager yourself as terry wrote
revert / make headless from gui: VBoxManage startvm <NAME_OR_UUID> --type headless
Update on VirtualBox 5: VirtualBox GUI has the function to start in Background nativly included now, so still the tool is a shortcut but not even more needed to not be forced using the console
I use:
VBoxManage startvm <NAME_OR_UUID> --type separate
The type separate is experimental according to the documents, but it seems to work in bringing up the GUI after the VM has already been started headless.

Virtualbox remote display updates remote as well as local screen

Folks,
I am running Virtualbox on Windows 7. The guest OS also is Windows 7.
I configured rdp connection at port 5000 (as stated in the documentation) and am able to connect to ip:5000 using Microsoft Remote Desktop client.
However, the problem is that the screen of the guest VM is simultaneously being shown on both, local as well as remote, windows.
Is there a way to just close the local window without shutting down the VM itself? Perhaps something similar to headless virtualbox on Linux.
Thank you in advance for your help.
Regards,
Peter
You can start a Virtualbox VM without GUI from the command line using:
VBoxHeadless --startvm [vmname]
There is also a section about running headless VMs in the Virtualbox manual: http://www.virtualbox.org/manual/ch07.html
Using the VBoxManage startvm command with the --type option is superior to VBoxHeadless as the former doesn't require the command prompt window to remain open (which largely defeats the purpose I think).
Below is and example of its output:
C:\>"C:\Program Files\Oracle\VirtualBox\VBoxManage" startvm "My Virtual Machine" --type headless
Waiting for VM "My Virtual Machine" to power on...
VM "My Virtual Machine" has been successfully started.
C:\>
Note that control is returned to the common prompt, allowing it to be closed without terminating the instance. The VM's status will also still be reported by the VirtualBox GUI.
The VBoxManage startvm command is documented in chapter 8 of the VirtualBox manual.

How to make a VM instance running sneakily as if it is a remote server?

Both host and vm are xubuntu 12.04.
I know that VBoxManage startvm "name" will start a VM from command line but the GUI will pop up anyway. Is there a way to start this vm and make it running sneakily at the background? Thus I can access it as if it is a server. Previously I let the GUI up and do my job via the console of the host.
Thanks
I think you're looking for VBoxManage startvm "VM name" --type headless