Can I run a Virtualbox inside a Azure VM [closed] - azure

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 10 months ago.
Improve this question
I am looking to find out if the following is possible.
Create a VM in Azure (Windows 10), install Virtual Box and start a VM
in Virtualbox
Create a VM in Azure (Linux), install Virtual Box and
start a VM in Virtualbox
Because when I try it, the VM crashes. and I am losing connection to the VM. I have tried few options from the list here sizes of vms on Microsft page Dv3 is what I tried, its not making any difference however. I am seeing statements like the nested virtualization is not support in some places, and also seeing statements like this has changed and its now supported. appreciate if anyone can comment on this as of today jan 2020
Edit:
date Jan-31-2020:
I have enabled the Hyper-V and did a vagrant up and now seeing this error
> PS C:\Users\sbolla\bionictest\.vagrant> vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'hashicorp/bionic64' version '1.0.282' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Fixed port collision for 22 => 2222. Now on port 2200.
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2200 (host) (adapter 1)
==> default: Booting VM...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
Command: ["startvm", "1580af6f-ce61-491c-8a8a-93dbc298cef4", "--type", "headless"]
Stderr: VBoxManage.exe: error: Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole
PS C:\Users\sbolla\bionictest\.vagrant>

Yes, you can run Virtualbox in Azure, there are 2 prerequisites to it:
The host VM should be of size "v3"
As per the MS article, nested virtualization is supported only on Windows 10 & Windows Server 2016.
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/nested-virtualization
As of 7th July 2020, nested virtualization is supported as below:
VMware - No
VirtualBox - Yes
Hyper-V - Yes
I have tried and tested it on Windows 10 by installing Kali Linux and yes it works, both on Hyper-V & VirtualBox, but the problem I am facing is that it is quite unstable. My host reboots every now and then, and the performance of the nested VM is very bad after it is rebooted the first time. Currently, I am not sure if it is only me facing such problem or is it with everyone.
Haven't tried VirtualBox on Linux Host yet.

Agreed with #Falco, you need to enable the virtualization for the VM, not only create the VM with the VM size Dv3 but also need to enable it with the script or manually use the PowerShell command. See more details about the steps that How to enable nested virtualization in an Azure VM.

Related

Vagrant The machine is in the 'gurumeditation' state After Installing Android Emulator and Minikube

Hy folks, I'm using Vagrant box provisioned with Ansible and provider Oracle virtualbox, it was working fine for me.
But one day i installed Android Studio and it's Emulator and Minicube wit KVM.
Afterwards vagrant with virtual-box just stop working. Now whenever i run vagrant up i get below error.
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/bionic64' version '20200416.0.0' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'gurumeditation' state. Please verify everything is configured
properly and try again.
If the provider you're using has a GUI that comes with it,
it is often helpful to open that and watch the machine, since the
GUI often has more helpful error messages than Vagrant can retrieve.
For example, if you're using VirtualBox, run `vagrant up` while the
VirtualBox GUI is open.
The primary issue for this error is that the provider you're using
is not properly configured. This is very rarely a Vagrant issue.
I need to run all of three on Ubuntu, How can i fix this?
1) Stop the VM
VBoxManage controlvm vm_123 poweroff
2) The check the settings.
VirtualBox will likely tell you there are some incompatible settings; correct those.
It could be the embedded virtualisation, or 32 vs 64 bits, or the amount of RAM for display or the virtual VGA display type, etc.
I had a gurumeditation issue with a fresh debian/buster64 and a reboot of my laptop fixed it (Virtualbox was only tellig me that the state was invalid in the log).
Some time lost for nothing. If ever it can help

vagrant up command SSL certificate problem

I'm on Windows 7. The Vagrant up command, it keep giving me this:
vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> defau
lt: Box 'ubuntu/trusty64' could not be found. Attempting to find and install...
default: Box Provider: virtualbox default: Box Version: >= 0 ==> default: Loadin
g metadata for box 'ubuntu/trusty64' default: URL: https://vagrantcloud.com/ubun
tu/trusty64 ==> default: Adding box 'ubuntu/trusty64' (v20190514.0.0) for provid
er: virtualbox default: Downloading: https://vagrantcloud.com/ubuntu/boxes/trust
y64/versions/20190514.0.0/providers/virtualbox.box default: Download redirected
to host: cloud-images.ubuntu.com default: An error occurred while downloading th
e remote file. The error message, if any, is reproduced below. Please fix this e
rror and try again.
SSL certificate problem: self signed certificate in certificate chain
I have searched the web for a solution but got nothing, also i'v try to reinstall the latest version of vagrant and virtual machine but got nothing
Any ideas?????
The problem i posted solved by pausing the antivirus on my pc.
after that i vagrant up again then i got the following:
The guest machine entered an invalid state while waiting for it
to boot. Valid states are 'starting, running'. The machine is in the
'unknown' state. Please verify everything is configured
properly and try again.
after so much trials oracle vm GUI gives me this message:
VT-x/AMD-V hardware acceleration is not available on your system. Your 64-bit guest will fail to detect a 64-bit CPU and will not be able to boot.
This usually solved from bios by enabling the VT-x graphics,but in my bios was no option like this so after going back to intel documentation it's turn out that my cpu doesn't support VT-x

Ubuntu 18.04 Server - how to check DNS IP server setting being used [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 months ago.
The community reviewed whether to reopen this question 6 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
Working with Ubuntu 18.04 Server LTS. I am trying to find a way to check the DNS IP(s) that is actually being used when set via DHCP. The resolv.conf only will point to 127.0.0.53 now. /etc/systemd/network folder is empty. The NSLOOKUP output also always references the internal 127.0.0.53 IP. Seems all the old tricks aren't working.
The Ubuntu documentation is not updated yet as it still looks like the help for 16.04 referencing eth0, ifup and ifdown which are all deprecated on 18: https://help.ubuntu.com/lts/serverguide/network-configuration.html
I've tried setting a static adapter setup with Netplan via a custom .yaml. The settings work fine but I can't seem to find the DNS IP that I set anywhere. I expect it will be consistent between DHCP and static settings but I'm not sure where to look now.
I would settle for either a C library call or a bash CLI method at this point. Does anyone have a way to check this on 18.04 Server?
I found the following showed my the DNS servers by adapter towards the end of the output:
systemd-resolve --status
It contains a list under 'DNS Servers' organized by Link. I think this has changed from previous versions with Ubuntu. It will take a little text parsing work but this gives me what I'm after.
Another way is:
cat /run/systemd/resolve/resolv.conf
That file is dynamically generated by systemd-resolved, but contains the actual DNS servers instead of 127.0.0.53.
In fact, if you want make that the default for /etc/resolv.conf, you simply create symlink for it. (/etc/resolv.conf is a symlink that points to /run/systemd/resolve/stub-resolv.conf by default):
sudo mv /etc/resolv.conf /etc/resolv.conf.orig
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
Sample /run/systemd/resolve/resolv.conf :
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients directly to
# all known uplink DNS servers. This file lists all configured search domains.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.
nameserver 10.1.2.3
search host.domain.com
For more info:
http://manpages.ubuntu.com/manpages/bionic/man8/systemd-resolved.service.8.html
You can also use:
nmcli dev show eth0
Replace eth0 with your network interface to see how it was configured. If you got the DNS address over DHCP, you should see it here.
I'm running ubuntu 22.04.
sudo nmcli dev show <interface> didn't have any dns listings, but sudo resolvectl status <interface> showed me the current dns server.
I am suprised at this too. I am running Ubuntu 16.04 LTS and see something similar.
If you issue a
dig www.google.ca +trace | grep 'Received'
The first host in the response is the one doing the lookups for your server.
$ dig www.google.ca +trace | grep 'Received'
;; Received 525 bytes from 127.0.1.1#53(127.0.1.1) in 19 ms
;; Received 42 bytes from 199.7.91.13#53(d.root-servers.net) in 32 ms
This means that this box is doing it's own dns lookups directly to the root servers and following the path recursively to get my dns lookups.
Found the issue is that dnsmasq is enabled. To disable it do as follows.
edit the NetworkManager.conf file
sudo gedit /etc/NetworkManager/NetworkManager.conf
comment out the dnsmasq line
#dns=dnsmasq
restart the network-manager service
sudo /etc/init.d/network-manager restart
then verify that it is using the dns-server assigned via dhcp
$ dig www.google.ca +trace | grep 'Received'
;; Received 525 bytes from 192.168.30.1#53(192.168.30.1) in 18 ms
;; Received 42 bytes from 198.41.0.4#53(a.root-servers.net) in 32 ms

PXE use part of my kickstart file [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 5 years ago.
Improve this question
I'm trying to deploy an easier way to configure my computers.
I'm using an Ubuntu Server as DHCP and tftp server to manage PXE installations.
I find help with ubuntu netboot and with ubuntu PXE install server
Everything is fine until my menu on my futur well installed computer.
It tries to connect to ubuntu mirrors.. It's a huge problem because it doesn't have internet connection !
I've mount an image of Ubuntu Trusty on my Ubuntu Server (thank to Apache) and my link is available.
Here is my code
DEFAULT vesamenu.c32
timeout 100
display boot.msg
menu background splash.png
menu title Welcome to my awesome installer
label Install new computer
kernel ubuntu-installer/amd64/linux
append ks=http://ip.local.server/ks.cfg vga=normal initird=ubuntu-installer/amd64/initrd.gz
When I make my decision to select "Install new computer" it seems working but finally the installer installs network tools (configure ip v4, searched dhcp, configured ip v6) and fail when try to connect to Ubuntu mirror. But I don't want it to connect to mirrors because files are already downloaded on my Ubuntu Server (http://ip.local.server/ubuntu-trusty).
It didn't seems to understand that my ks.cfg is here (http://ip.local.server/ks.cfg).
ks.cfg:
#Generated by Kickstart Configurator
#platform=x86
#Install OS instead of upgrade
install
#Use Web installation
url --url http://192.168.3.1/ubuntu-trusty
#### Mirror settings ###
d-i mirror/country string fr
d-i mirror/http/hostname string http://192.168.3.1
d-i mirror/http/directory string /ubuntu-trusty
d-i mirror/suite string trusty
#d-i mirror/country string fr
#System language
lang fr_FR
#Language modules to install
langsupport fr_FR
#System keyboard
keyboard fr
#System mouse
mouse
#System timezone
timezone Europe/Paris
#Root password
rootpw --disabled
#Initial user
user myuser --fullname "MyUser" --iscrypted --password $1$tDwZTgoh$a25ayXUItWDWxdQlUg0Tk1
#Reboot after installation
reboot
#Use text mode install
text
#Use interactive kickstart installation method
interactive
#System bootloader configuration
bootloader --location=mbr
#Clear the Master Boot Record
zerombr yes
#Partition clearing information
clearpart --all --initlabel
#Disk partitioning information
part swap --size 4000
part / --fstype ext4 --size 1 --grow
#System authorization infomation
auth --useshadow --enablemd5
#Network information
network --bootproto=static --ip=192.168.3.222 --netmask=255.255.255.0 --nameserver=192.168.3.1 --gateway=192.168.3.1
#Firewall configuration
firewall --disabled
#X Window System configuration information
#xconfig --depth=32 --resolution=2048x1536 --defaultdesktop=GNOME --startxonboot
This ks.cfg file was generated directly from system-config-kickstart.
Edit:
I've set a static ip on my ks.cfg and with a tcpdump on my server I can see requests with this ip. This means my ks.cfg file is read but I still don't know why it's searching to access mirrors on the web instead of searching on my server.
Does anyone have an idea of this mirror researches that fail my PXE installation?
Thank you in advance.
First let me ask if you have turned your HTTP server on? in your case the ks.cfg file is going to be retrieved by an http transfer from
http://ip.local.server/ks.cfg
Next for the mirror parameters in your ks file you have to add something like
(Ubuntu)
#### Mirror settings.
preseed mirror/country string manual
preseed mirror/http/hostname string thinkmate5.ma.utexas.edu
preseed mirror/http/directory string /mirror/precise/ubuntu
preseed apt-setup/security_host string thinkmate5.ma.utexas.edu
preseed apt-setup/security_path string /mirror/precise/ubuntu
(Debian)
#### Mirror settings.
d-i mirror/country string fr
d-i mirror/http/hostname string http://ip.local.server
d-i mirror/http/directory string /ubuntu
d-i mirror/suite string trusty
#d-i mirror/http/proxy string
you could also add mirror settings at the "append" line like
mirror/country=manual mirror/http/hostname=aaa.bbb.ccc.ddd mirror/http/directory=/directoryXX mirror/http/proxy=""
Booting with kickstart have multiple layers and not all information is send from one layer to the next.
Even though your DHCP server have send an ip and information about bootfiles to the loader program ( often that is syslinux or pxelinux ) this information is not send to the OS when it boots. The kickstart file is only read after the system boots and the install program have started ( often that is anaconda ).
I think you need to pass ip=dhcp somewhere on the append line. In my setup I also have keymap=dk lang=en_US on this line to setup language and keyboard settings.

Timed out while waiting for the machine to boot when vagrant up [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I have an Ubuntu 13.10 and I installed Vagrant 1.5.4 and VirtualBox 4.3.10r93012. My problem occurs when I write the command vagrant up at the first time the script up the virtual machine correctly. But after doing vagrant halt and write the command vagrant up again, a problem occurs:
vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
Is there any solution? Thanks.
I increase the time using config.vm.boot_timeout. But for me it was not the reason although the error tells about a timeout.
I opened the Vagrantfile using vim and add the following lines which turns on GUI for the VM.
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
After re-running the vagrant up i saw the real reason in the GUI. There was an error dialog and it keeps waiting. That was the reason for the connection timeout.
To fix this i had to do some configurations in the system BIOS. I had to turn on the intel VT-x setting. And please check for AMD-V setting as well. These settings help hardware virtualization.
Select your Ubuntu server, click on Settings, go to Network tab and make sure that your Cable Connected option is selected.
I used "vagrant destroy" and solved the problem.
This command stops the running machine Vagrant is managing and destroys all resources that were created during the machine creation process. After running this command, your computer should be left at a clean state, as if you never created the guest machine in the first place.
I had the same problem on windows 10 and the solution for me was to enable Intel Virtualization.
I'm afraid I can't give you specific instructions, as far as the BIOS menu options vary from computer to computer depending on the manufacturer. However, generally you should follow these steps:
1-Power on the machine and open the BIOS.
2- Open the Processor submenu. The processor settings menu may be hidden in the Chipset, Advanced CPU Configuration or Northbridge.
3-Enable Intel Virtualization Technology (also known as Intel VT) or AMD-V depending on the brand of the processor.
4- Save the changes and restart.
You need to able the GUI. Remove the comment of this lines in your Vagrant file:
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
After you need shutdown your machine and start again:
vagrant halt
vagrant up
I was also getting error message Timed out while waiting for the machine to boot. After enabling the GUI through vagrant file, I could see that vagrant tp was asking for login & password. providing vagrant/vagrant worked but the machine was still not up.
Finally, Vagrant destroy worked. After this vagrant up provisioned machine & now I could do ssh.
I know this is an old thread, but I recently ran into this same issue with an Ubuntu vagrant box (19.04) and wanted to post the solution that worked for me.
The key part was the number of cpus. The box had been trying to boot with 2 enabled and that was absolutely killing the performance during boot, so much so that vagrant would time out waiting.
By setting it to 1 my box came up immediately on vagrant up!
In your Vagrantfile under the config.vm.provider "virtualbox" do |v| section try adding v.cpus = 1 and see if that helps.
Hope this helps someone else having a similar issue.
You probably enabled firewall which is causing the problem.
Just add
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
to your VagrantFile then vagrant up. Login wth vagrant credentials on the gui window and disable the firewall with sudo ufw disable.
Restart vagrant and everything should be fine.
vagrant halt
vagrant up
I had tried everything but didn't work for me any solution. Then i had found this solution on github. Check the solution.
Option 1:
Restart and keep pressing F10 to open BIOS settings.
Open Advanced CPU Configuration. (Try to find Virtualization technology settings.)
Enable Intel Virtualization Technology (also known as Intel VT) depending on the brand.
Save the changes and restart.
Option 2:
Open up the command prompt of your windows. You should open terminal or command prompt as an administrator and then
then type:
bcdedit /set hypervisorlaunchtype off
Restart your computer.
find more details from this blog
I had the same issue on a Windows 10
default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key Timed out while waiting for the
machine to boot. This means that Vagrant was unable to communicate with the guest machine within the configured ("config.vm.boot_timeout" value) time period.
And this solution worked for me :
Open up the command prompt of your windows as an administrator and run :
bcdedit /set hypervisorlaunchtype off
Restart your computer.
just enable virtualization technology of cpu setting in BIOS
Just paste this code in your variant file and it will work fine.
config.vm.boot_timeout = "1440"
After saving changes, enter the vagrant provision command to update changes
Then run vagrant ssh to start a homestead
Edit config.vm and increase the value of config.vm.boot_timeout to your needs.
Prerequisite: Please Make sure your virtualization is enabled.
I had the same problem in my windows 10 system and I researched a lot about the issue in both StackOverflow and GitHub issues but nothing worked. So I simply updated my virtual box to the latest version and rebooted the system. Afterwards, it worked absolutely fine for me :)
Potential Issue: Virtualization might be disabled in your bios
Restart your computer and keep hitting F10 key. This will take you into the system BIOS. There you can check if your Intel-Virtualization is disabled. If so, change it to Enabled, save and continue to restart your pc.
Few things you can try:
Check the Vagrant version (vagrant -v) you are running and it should be latest. Also run vagrant box update.
Increase config.vm.boot_timeout value in Vagrantfile.
Add vb.gui = true after config.vm.provider :virtualbox do |vb| line in Vagrantfile to open VM with GUI. Try reload, and see what is the exact error at which it is getting stuck and try fixing that.
Also click on Settings, go to Network tab and make sure that your Cable Connected option is selected.
Once GUI is enabled try reloading and once the login screen is up, you can login with the username vagrant and the password is the same as the username. You need to open up /etc/default/grub. Add the following to the bottom of the file and save the file: GRUB_RECORDFAIL_TIMEOUT=2. Run sudo update-grub. Shutdown the VM and run vagrant up.
What worked for me is vagrant destroy and then vagrant up
The drawback is it deletes all the database and you need to run your migrations again.

Resources