How to I setup a VM with GUI - hyper-v

I've created a VM on Hyper-v(windows 10). When I start the server, it loads with a black screen. Withe the cursor blinking
Ive created the VM as suggested by their docs.

The mistake was that I was missing an OS installation, the site suggested to click finish, which added the VM without the OS by default

Related

VirtualBox won't run win10: Failed to open a session for the virtual machine w10. Result Code: NS_ERROR_FAILURE (0x80004005)

Ok so I want to get a virtual machine with Windows so I can download applications only on Windows (Not on OSX (I'm on Big Sur 11.2.3 by the way)), so I downloaded VirtualBox, then downloaded the Windows thing which apparently I have to (as seen in one of the pics) (you can tell I have hardly any experience with vms), then I created a new vm in the VirtualBox app, and left all the default settings except for the type of hard drive (which is also in one of the pictures), then I clicked Start and it asked me to add a 'virtual optical disk file', so I clicked on the folder button then clicked add in the top left, and it gave me this error code:
Failed to open a session for the virtual machine w10.
The VM session was aborted.
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: SessionMachine
Interface: ISession {c0447716-ff5a-4795-b57a-ecd5fffa18a4}
as you can also see in one of the pictures below. Also, when I leave the screen for a couple of minutes right before I click on the previously mentioned add button, this appears:
but I tried just leaving it to load, and nothing happened. I have tried uninstalling using the uninstall tool twice, rebooting my Mac, etc etc, and yes I have allowed everything I need to in the Security settings. I'm not installing it on a moderator account, but the Windows 10 virtual optical disk file is in Documents which the account I'm on has read and write access to, and obviously the actual VM is in applications.
Thanks so much!
Here's the previously mentioned image of the one changed setting:
And here's the pic of the Win10 64-bit I had to install:
thanks everyone!
VirtualBox Version: 6.1.22 r144080 (Qt5.6.3)
Host Operating System: MacOS BigSur
I came across exactly same issue, where clicking on add to choose image was crashing the dialog. This issue persists in the latest version of Virtual Box for Mac.
I could figure out couple of ways to avoid clicking on Add button to choose image.
First Option:
Steps:
Click on Settings to open settings window for your VM.
Choose Storage
Select Empty disc and choose Disk image by clicking small disc icon in the Attributes section. Please follow the image to have visual instructions.
Second Option:
Steps:
Click on VM's Normal start
Once you get the option to choose image, simply cancel the dialog.
Now click on the small disc icon in the bottom of VM's dialog to choose the image.
Hope this helps. Feel free to comment if you find this post useful.
I had the same message because of permissions at directories where the hard disks were stored in. So, just execute VirtualBox 'As Administrator' and all run well.
I was getting the same error on Ubuntu 22.04 machine while trying to start an existing or a new VM-
Failed to open a session for the virtual machine NuacareRocky.
The VM session was aborted.
Result Code: NS_ERROR_FAILURE (0x80004005)
Component: SessionMachine
Interface: ISession {c0447716-ff5a-4795-b57a-ecd5fffa18a4}
I tried a few things as suggested on youtube, but nothing worked. finally, I just upgraded the extension and it worked.

VSCode through Mobaxterm cannot be moved, resized or maximized

I'd like to try out VSCode. I code usually on Qt Creator on a remote machine with Ubuntu/Debian, which I access through Mobaxterm (ssh) with X11 forwarding on Windows. I installed the latest VSCode (code_1.30.1-1545156774_amd64.deb), and I ran it with code, but I can't maximize the window or move it in anyway. The maximize button is completely unresponsive and doesn't do anything. Trying to drag the window or resize it by hand also doesn't do anything.
Is there some configuration to do to make it do these things?
Just found the answer:
https://github.com/Microsoft/vscode/issues/65232#issuecomment-449010667
in ~/.config/Code/User/settings.json
"window.titleBarStyle": "native"
if the file doesn't exist, create a new one with this line:
{ "window.titleBarStyle": "native" }

virt-manager guest resize not working

Installed virt-manager,
target virtual machine is debian jessie with spice-vdagent installed
shared clipboard, and latency-free mouse input works
Display: Spice
Video: QXL
Channel spice: spicevmc, virtio, com.redhat.spice.0 (confirmed /dev devices exist in target vm)
Make sure guest resizing is enabled in virt-manager:
Menu View -> Scale Display ->
Auto resize VM with window (Checked)
Make sure your have a spice agent on your guest (the virtual machine)
https://www.spice-space.org/download.html#guest
'spice-vdagent' on linux
'spice-guest-tools' on windows
How I figured this out,
I found a setting in "spicy" that I assumed had an equivalent in virt-maanger. To connect with spicy from spice-client-gtk apt package, I found the port to connect to by checking sudo ss -nlp | grep qemu, and connected to that port on localhost. Spicy's toggle was much easier to find: Options -> Resize guest to match window size (Checked).
For XFCE, this is a known bug which does not appear to have been fixed yet (confirmed still broken in Xubuntu 20.04).
This issue is due to a change in spice-vdagent whereby instead of changing the resolution directly, it instead notifies the DE to make the change, and that functionality has not been implemented yet in XFCE.
One workaround is to run the following in the guest every time you resize your window:
$ xrandr --output Virtual-1 --auto
According to Installing Windows 10 in KVM + libvirt, visit Spice then scroll down to Windows binaries and then click the link spice guest tools. Proceed to install the spice tools after download completes. Once installation is complete, you should be able to get the guest VM resolution to match that of the resized VM window.
For me, "Auto resize VM with window" was greyed out until I installed the spice guest tools; I did not even have to reboot after installation - this feature was available immediately and it just worked - :).
Host machine: Ubuntu 16.04.6 LTS (Xenial Xerus)
Guest VM: Windows 10 Pro (Version 1809 build 17763.379)
#ThorSummoner's approach works, but if you have a high resolution monitor, the guest video driver may not have enough memory to draw the larger screen. In that case, you will need to increase the video memory, but unfortunately the virt-manager GUI doesn't provide a method to do so. So instead follow this procedure:
View -> Details -> copy the UUID.
sudo virsh edit <copied uuid>
Look for a line like the following: <model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>. Your type and other parameters may be different, but as long as there's a vgamem, you can continue.
Change vgamem to 32768
Save & exit. The config file will automatically be checked for errors.
Then restart your VM, and try again.
Short answer that worked for me:
I also have Display set to Spice. If the VM's virtual Video hardware was set to VGA or QXL, I could not resize the desktop in the guest. When I changed Video to Virtio in virt-manager and restarted the VM, it worked.
Longer background in case it's useful to future visitors:
I ran into this problem in May 2020 and while the older answers here were of some help I thought I'd add some clarifications since the virt-manager UI and libvirt capabilities continuously evolve.
In my case, I have a Fedora 32 (KDE Spin) Linux host and the same OS in the guest. My virt-manager version is 2.2.1.
As with thorsummoner's original situation above I am using Display Spice so I can have goodies like the shared clipboard between host and guest.
The guest seemed stuck on 1024x768. xrandr in the guest showed lots of higher resolutions available, but when I tried to set the resolution to 1920x1080 -- whether with xrandr --output Virtual-1 --mode 1920x1080 or with Plasma's Display setting -- it would only momentarily change to the higher resolution. Then, clunk, it would change right back.
Explicitly setting a higher level VGA video memory did not work (although it did help for another problem long ago).
No matter what I set virt-manager's View -> Scale to display menu options to, this still happened.
The fix for me was in the virtual hardware Video settings. Note: not Display, but a separate entry further down in the left-hand-side Hardware list in virt-manager.
If video was set to VGA or QXL, I could not resize the guest.
Then I changed the video hardware to Virtio, and the problem went away. I could resize the desktop with either xrandr commands or the GUI Display preferences, and the changes would stick even after restarts.
Of course the guest VM should be cleanly shut down before making this change to its virtual hardware settings.
What worked for me is much simplified modified ThorSummoner's answer:
Step 1:
View > Scale Display > Always
Step 2:
View > Scale Display > Auto Resize VM with window
Step 3:
In the guest OS, set the desired resolution.
I tried everything I saw to make it work but the only thing that worked for me was to set video to QXL (didn't tried Virtio or VGA after that tho) and do a proper shutdown of the Windows 10 VM (from inside the VM, do a "shutdown"). If you use the reboot from virt-manager it seem's like it doesn't reboot entirely.
What worked for me (finally!):
Debian 11.6 on my host laptop.
Debian unstable as my guest VM.
In the guest, "apt install spice-vdagent".
In the guest details (View / Details):
Display Spice = Spice Server
Video = QXL
View / Scale Display = Always
When logged into KDE Plasma (X11) as my Desktop Environment, the View / Scale Display had the "Auto-resize window with VM" option selected, but it was grayed out and KDE's resolution would not resize as I changed the guest window size; it would scale to some degree, but it seemed to be using a magnification effect rather than actually changing the resolution.
When logged into Cinnamon or into Gnome (just plain "Gnome", not "Gnome Wayland" or "Gnome on Xorg" or any of the other Gnome options in my selection pull-down menu), the View / Scale / Auto-resize was not grayed out, and both DE's resized as I resized the guest window.
Note: the resizing was not instantaneous; it took a second or two after I finished resizing the guest window before the DE changed resolution to match.
In my case, I had manually set resolution to 1920x1080 prior to booting with SPICE vdagent. I just had to go to settings, display (will depend slightly between DE), and select the resolution corresponding to SPICE resize mode.
For those of you who still haven't got virt to auto-resize with suggested config (spice channel, spice guest tool, QXL), this is how I solved mine.
Background: I got it to auto resized before, but I got a clean install of ubuntu, and using the same config, same vm files (was actually physical partition), but I can't get it to resize again. I got spice channel in the config with QXL video, spice guest tools in windows guest, but still can get it to resize.
So finally, I just got a clean install of both windows and my distro (this is not the solution, just indicating that my config was clean). I tried again with the same config but nothing work, and I started to wonder if windows I the problem here, which it ultimately was. I checked the device manager to see that 2 virtio drivers were rejected by windows secure boot. So as an instinct I went in tiano bios (ovmf) and disable secure boot. It's working fine now.
Form me it was just a matter of going to the VM click Show virtual hardware details icon, resize that window, then click back on the Show the graphical window icon since they share the same window.
Resizing on Windows guest works if you install the virtio display driver.
Open "Device Manager", right click on "Display adapters", right click on the one entry you find, then "Update driver", browse for a driver, select the virtio ISO, and install the driver.
Notice the entry won't be displayed with a yellow warning sign, as Windows will use the Microsoft Basic Display Adapter drivers, and so it is all fine for it.

How to run a command in cmd on startup in Windows XP

Sigh. For reasons, I am running a windows xp virtual box in ubuntu. In this instance of windows there is an express (node) server running. Everything works fine, except that occasionally windows crashes or the virtual box freezes (perhaps after being left idle for several days). I would like to restart the virtual box (and node server) programmatically when this happens. The actual restarting of the virtual box from linux seems attainable, but I can't figure out how to get windows to run "node .../server.js" on startup! I tried putting the command in C:\AUTOEXEC.bat, and it did not start when I restarted the computer. I know I'm asking for trouble with a 10 year old OS but it's what I have to work with. Any thoughts?
Try scheduling in as a task in the task scheduler.
Tasks get executed when their triggers are satisfied, and in this case you can use the 'at startup' trigger, as described here:
http://technet.microsoft.com/en-us/library/cc748841.aspx
At startup
This trigger causes the task to run when the computer starts up. The only settings for this trigger are the advanced settings described in the Advanced Settings section below.
Look out though, that information wasn't tailor-made for XP, but should do it for you.
I actually just got it working. I put a batch file in start/programs/startup that CD'd to the right directory and then ran node.

Chrome OS in VMPlayer

Trying to create a virtual machine using VMPlayer, I discovered that as the Chrome OS is now a Release Candidate, it is only available here: http://www.getchrome.eu/download.php
However, there is no .vmdk download but "Live CD" and "USB Disk Image". I've downloaded the "Live CD", but the VMPlayer couldn't create a new machine. Ive tried several samples from the internet, using the following methods:
Create it as Ubuntu.
Create it as a 2.6.x kernel.
Create a blank VM and point the HD to the .iso file.
I keep getting" "Failed to mount RW root filesystem" and then there's a 120 seconds suspension before a reboot (which causes the same error). The screen shot of the log (Alt+F3):
What am I missing?
In the link you've shared there is no .vmdk (and I couldn't find it around the web). So if I were in your shoes I would go to: http://www.chromium.org/chromium-os/developer-guide#TOC-Building-Chromium-OS
and try to built it with the spec (cpu, mem etc') that you have on the VMPlayer.
Another option is to try and install a built that someone did: http://www.tomshardware.com/news/chrome-os-google-vmware-download,9124.html
Good luck.
You can try Chrome OS by deploying ready-to-use Chrome OS VMs by hexxeh.