How do I enable nested virtualization on a Windows Server 2012 - server

I am trying to setup Configuration Management using Ansible, I'm running Windows Server 2012 and I need to setup a VM instance of Linux or Ubuntu and install virtual box again within the Ubuntu VM. for this to work I need to enable nested virtualization on the Windows Server 2012

you can enable this feature, by using the following command in an administrative PowerShell terminal,the VMName in the command is the name of your VM Instance.
Set-VMProcessor -VMName VMName -ExposeVirtualizationExtensions $true

Related

I want to install and connect to openVPN on windows machine through windows CLI commands

I want to install and connect to openVPN on windows machine through windows CLI commands, please help
In ubuntu machine we are able to install and connect it but through windows command prompt we are unable to do it, please help
These commands I need to execute in azure devops pipeline which runs on microsoft hosted windows machine
Run OpenVPN from a command prompt Window with a command such as: openvpn myconfig.ovpn. ...

Remotely connecting to Hyper-V machine from VM

I'm new to the concept of Hyper-V and how it works, so I'm not sure if this is a good question.
I have a server that contains the Hyper-V, and from the Hyper-V I connect to a VM (VM1). The VM1 contains Orchestrator that will be used to automate some jobs related to the machines in the Hyper-V sever. So I need to run some PowerShell commands, in VM1, to check the Snapshots of all the machines in the Hyper-V server.
I already installed the Hyper-V PowerShell module in VM1.
My question is, in order to get information about the machines in Hyper-V through VM1:
Do I need to install the Hyper-V Management Tools in VM1 and make a connection to the main Hyper-V server in order to get information about the other VMs in Hyper-V?
Can I do this by using a remote PowerShell session and then run the commands that I need against the Hyper-V server, remotely. Can I do this when VM1 is accessible through Hyper-V?
It's a bit difficult to explain, like I said I'm new to this topic. But I'm available to answer any question if my explanation was a bit confusing.
From VM1, you should be able to connect to the Hyper-V host using -computername and -name to reference the name of the VM:
$Host = "HypervHostServer"
$VM = "virtualmachine1"
Get-VM -ComputerName $Host -Name $VM
To see all virtual machines:
$Host = "HypervHostServer"
Get-VM -ComputerName $Host

remote connection using powershell from linux to windows

I am able to connect to a remote windows machine from my windows local machine using Powershell session created by New-PSSession command.
New-PSSession -ComputerName $computerName -Credential $cred
Now, I need to create similar remote session to a remote windows machine from my local LINUX machine. So, I installed powershell 6.0.2 on my red hat 7 linux box. When trying to create a remote session using New-PSSession command, I am getting following error:
New-PSSession : MI_Result_Access_Denied
I need to use only WinRM based approach and not SSH based as I cannot install any extra utility on remote windows machines.
kerberos auth is not supported in cross domain in its vanilla flavour. and Basic auth over HTTP is not supported from Linux. Installing OpenSSH on windows looks to be only way.

Installing kubernetes on windows 10

I am following the instructions on this page(https://kubernetes.io/docs/tasks/tools/install-minikube/) to install kubernetes on windows 10. I have enabled virtualzation on my system and have installed virtualbox. When i try to start the minikube, it fails with this error:
>minikube start
* minikube v1.9.2 on Microsoft Windows 10 Home 10.0.18362 Build 18362
* Using the virtualbox driver based on existing profile
* Starting control plane node m01 in cluster minikube
* Creating virtualbox VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
! StartHost failed, but will try again: creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
* Creating virtualbox VM (CPUs=2, Memory=2200MB, Disk=20000MB) ...
*
* [VBOX_VTX_DISABLED] Failed to start virtualbox VM. "minikube start" may fix it. creating host: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
* Suggestion: Virtualization support is disabled on your computer. If you are running minikube within a VM, try '--driver=docker'. Otherwise, consult your systems BIOS manual for how to enable virtualization.
* Related issues:
- https://github.com/kubernetes/minikube/issues/3900
- https://github.com/kubernetes/minikube/issues/4730
This is what i get when i do systeminfo from command prompt:
[03]: VirtualBox Host-Only Ethernet Adapter
Connection Name: VirtualBox Host-Only Network
DHCP Enabled: No
IP address(es)
[01]: ***.***.**.*
[02]: ****::****:****:****:****
[04]: VirtualBox Host-Only Ethernet Adapter
Connection Name: VirtualBox Host-Only Network #2
DHCP Enabled: No
IP address(es)
[01]: ***.***.**.*
[02]: ****::****:****:****:****
Hyper-V Requirements: A hypervisor has been detected. Features required for Hyper-V will not be displayed.
Does anyone know how to fix this?
Thanks
[VBOX_VTX_DISABLED] can means that either virtualization is not enabled in BIOS or Hyper-V is running and not allowing to access to VMX.
Assuming that you have enabled the virtualization it is worth checking out the second option and try to disable the Hyper-V.
You can do that by using this command in powershell:
`bcdedit /set hypervisorlaunchtype off`
You may also want to disable those two features:
Virtual Machine Platform and Windows Subsystem for Linux
Both can be found at Turn Windows Features on/off
Please also note that Microsoft is constantly adding features that are enabling hyper-v and prevent virtualbox from using vtx. Depending on system version some of them could be missing in your system but its worth checking them out and disabling them.
Application Guard
Credential Guard
Device Guard
Containers
Hyper-V
Virtual Machine Platform
Windows Hypervisor Platform
Windows Sandbox
Windows Server Containers
Windows Subsystem for Linux 2 (WSL2)
Remember to do do a cold boot (shut down for 10 seconds and start it up)

Do I have any way to connect to a Hyper-V Server using a PowerShell command?

To connect to a Hyper-V host from Hyper-V Manager, right-click Hyper-V Manager in the left pane, and then click Connect to Server.
Do I have any way to connect to a Hyper-V Server using a PowerShell command?
If so please include code (example my VM name is VM_1), thanks so much!
Install Hyper-V Powershell module from Windows Features.
Get-VM -ComputerName <servernames>
You will get list of VMs running under Hyper-V hosts.