How to emulate Windows RT - windows-8

How can I run Windows RT (the restricted ARM version of Windows 8) in an emulator, for development purposes? This question contains two parts:
Obtaining the image: Does an installation image exist (for vendors, in MSDN, ...)? Can I take a snapshot of the Surface RT disk (how?), or can I extract it somehow from recovery data (I don't know how the recovery system works, but there's a function to wipe and reinstall the software on the Surface completely).
Running the image: What can I emulate it on? I've heard about QEMU, but it has the reputation of being slow. Also, the program must emulate the neccessary hardware (Tegra-3).

I'm aware this question was asked 9 years ago, but now it's possible to emulate Windows RT in patched QEMU 6.2.0, you can also read more about the work being done for it.
The repo with downloads is here: https://github.com/binarymaster/qemu/releases
Please note that there is no audio, no network, and no GPU acceleration supported. Although you can have network connection with Windows 10 ARM, just read my previous answer below.
Answer from May 13, 2020:
I'm aware this question was asked 7 years ago, but now it's possible to emulate Windows on ARM in the latest QEMU 4.2.0.
Steps to follow:
Patch QEMU to report EL3 TrustZone available: https://github.com/TeoIzAwezome/rtemu/commit/0f8b8ec18725cd0f66a39b5520fb6a435a757f95 - if you're using Windows and don't want to build QEMU from source, you can patch qemu-system-arm.exe : replace this hex sequence with NOPs 4531C931D24C8D05BE515C004889F1E87AD82E00 => 9090909090909090909090909090909090909090 - it replaces this part:
Download Linaro firmware for QEMU 32-bit ARM platform, specifically 15.12 version which is the last one that boots Windows on ARM without problems: https://releases.linaro.org/components/kernel/uefi-linaro/15.12/release/qemu/QEMU_EFI.fd
Download an ESD image of Windows RT 8.1, these are publicly available from Microsoft.
You can find download links here https://tech.myonlylonely.com/wimboot-for-surface-2-en/
or by using Google with this string: 9600.17053.winblue_refresh.141120-0031_woafre_client_CoreARM_O15_en-us-IR5_CCSA_WOAFRER_EN-US_ESD_2F1E1C773E39C4672F52B1F3A0AE7844FD837B23.esd
Either convert ESD to ISO or just extract it with esd-decrypter-wimlib-8.7z : https://www.tenforums.com/software-apps/27180-windows-10-recovery-tools-bootable-rescue-disk-2.html
You will need VirtIO drivers for QEMU compiled for 32-bit ARM platform, precompiled viostor.sys driver is available here https://www.betaarchive.com/forum/viewtopic.php?f=62&t=40522 - if you built drivers yourself in Visual Studio, make sure to create catalog files by using Inf2Cat /driver:C:\Drivers\ /os:8_ARM,6_3_ARM and test-sign them (all .cat and .sys files); once drivers are ready, you can slipstream them into boot.wim and install.wim by using dism /Mount-Wim + /Add-Driver + /Unmount-Wim
If you don't want to boot and install from ISO, you can create a VHD/VHDX disk image and format/partition it the same way as it's done for Windows installation on UEFI systems — GPT partitioning: EFI partition - FAT32, MSR partition, Primary partition - NTFS. Use dism /Apply-Image with install.wim to install Windows files to created disk, and bcdboot to install EFI files
Since you're using test-signed drivers, you need to tweak BCD file on EFI partition:
set BCD=E:\EFI\Microsoft\Boot\BCD
bcdedit /store %BCD% /set {globalsettings} testsigning on
bcdedit /store %BCD% /set {globalsettings} nointegritychecks on
Once everything is done, start QEMU with these parameters:
set HDD=windows-on-arm.vhd
set ISO=en_windows_8.1_ir4_ARM_dvd.iso
qemu-system-arm ^
-M virt ^
-cpu cortex-a15 ^
-smp 2 ^
--accel tcg,thread=multi ^
-m 2G ^
-bios QEMU_EFI_1512.fd ^
-device VGA ^
-device ich9-usb-ehci1 ^
-device usb-kbd ^
-device usb-tablet ^
-drive if=virtio,file=%HDD% ^
-device virtio-scsi-pci,id=scsi0 ^
-device scsi-cd,drive=install,bus=scsi0.0 ^
-drive if=none,format=raw,id=install,file=%ISO%,readonly=on ^
-rtc base="2013-07-15",clock=vm
Notes:
There is known problem with PCI MMIO area, and USB input wouldn't work because of it. You can workaround that by replacing -M virt with -M virt,highmem=false however with this option Windows 8.1 RT will throw BSOD with code SYSTEM_THREAD_EXCEPTION_NOT_HANDLED.
It's known Windows 10 for ARM does not throw this BSOD code and works in QEMU pretty well with -M virt,highmem=false. You can use Google to get it: 10.0.15035.0.rs2_release.170209-1535_armfre_client-enterprise_volume_en-us :
Also note that full emulation of 32-bit ARM is very slow even on Intel Core i7-8700 # 3.2 GHz, so it's better to use some modern ARM board like Raspberry Pi 4 that have hardware accelerated KVM hypervisor.
Windows for 32-bit ARM is already considered legacy, better switch to AArch64 aka Windows for ARM64, see https://withinrafael.com/2018/02/12/boot-arm64-builds-of-windows-10-in-qemu/

There's no way to truly emulate a Windows RT enivonrment on ARM. You have two options...
1) Go pick yourself up a Surface tablet.
2) Contact your local Microsoft Technical Evangelist to see if they have loaner hardware available.
Also, chances are your local Microsoft Evangelist team is holding Windows 8 developer events where they may have test hardware on hand for you to try. If you're in the US, you can find a list of these events at http://msdnevents.com.

Related

Ubuntu 16.04 screen completely freezes only mouse moves

Ever since I have upgraded my laptop (Click here for hardware specs.) my screen usually freezes. Mostly in chrome or Firefox browser. I am pretty sure this is a Nvidia driver problem but I can't seem to find the solution. I am running a Nvidia Quadro K2100M.
I am currently running Nvidia 361.42. I have tried using open source Xorg server without any luck.
The only solution I have found so far is forcefully turning off the computer by holding down the power button.
Things that I have tried:
I got keyboard input
I cannot switch to another terminal to restart lightdm
This problem came to me occasionally, making me really annoyed.
As illustrated in many blogs, this may be caused by graphic driver problem. For me, my desktop has a NVIDIA video card, you can run lspci | grep VGA to see what type of your video type, in my case, it returned:
02:00.0 VGA compatible controller: NVIDIA Corporation G98 [GeForce 8400 GS Rev. 2] (rev a1)
I followed the instruction on jiakai zhang's blog to reinstall proper drivers for the desktop, hope this will help you.
The key steps in [1] are to reinstall the ubuntu desktop and nvidia drivier by:
$ sudo su
$ apt-get update
$ apt-get install --reinstall ubuntu-desktop
$ apt-get install unity
$ apt-get remove --purge nvidia*
$ reboot
$ sudo apt-get install nvidia-current
$ sudo reboot
Updating the grub settings worked for me! Do the following:
1. Open the GRUB configuration
sudo vi /etc/default/grub
2. Change the value of GRUB_CMDLINE_LINUX_DEFAULT from "quiet splash" to
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_idle.max_cstate=1"
and save the file.
3. Update & Reboot
sudo update-grub
sudo reboot
More info:
This is a bug in the processor, known as the c-state bug. It causes total freezes when the CPU tries to enter an unsupported sleep state. It's a problem for many Bay Trail devices especially with newer (4.*) kernels. There is a simple workaround until it gets properly fixed upstream. You just need to pass a kernel boot parameter and the random freezing stops completely. The parameter may increase battery consumption slightly, but it will give you a usable system. You do this by editing the configuration file for GRUB as described above.
GRUB - boot loader package from the GNU Project, which provides a user the choice to boot one of multiple operating systems
installed on a computer or select a specific kernel configuration available on a particular operating system's partitions;
Intel Bay Trail - new Atom Processors from Intel. Atom is Intel's family of x86 and x86-64 processors that are optimized
for small computing devices, such as smartphones and mobile Internet devices;
C-States - used to optimize optimize or reduce power consumption in idle mode (i. e. when no code is executed) - (C0 to C8)
Reference: here.
I have since fixed this problem by re-installing Ubuntu 16.04 and not switching from the nouveau video driver. I also disable updates and everything been working good for about 2 months now.
Gaming is pretty good but I usually play steam games so doesn't push any kinda hard core graphics
Well, I had the same problem: My PC was freezing randomly. I tried Ubuntu 16, 17 and 18.04 and everything was the same. I tried several drivers and didn't get a solution. I tried several solutions that I found in the forums (including this) and got bad and harmful results.
My solution was: I stopped using the graphical nvidia card, removed it and now I'm using the integrated Intel HD graphics card (Intel® HD Graphics 530 card (Skylake GT2)) and all the problems were solved!
I fixed mine using a few commands from #Qoros solution above. i just ran apt-get update, apt-get install nvidia-current, and sudo reboot. cheers to #Qoros btw!
For me, none of the approaches described in rest of the answers worked.
I was opening multiple terminal tabs running some heavy processes and ubuntu used to freeze when I had 6-7 tabs. I tried monitoring the resources used while I was starting my processes in terminal tabs. You can do it by opening System Monitor app and going to Resources tab.
What I noticed is that when my RAM(8GB) and my swap space(1GB) were completely used up, ubuntu would freeze.
As a solution, I increased my swap space and made it 16GB. After this memory never gets used completely and ubuntu doesn't freeze.
https://askubuntu.com/questions/178712/how-to-increase-swap-space decsibes how to increase swap space.

Setting up desktop environment on NetBSD 6.1.5

I have installed NetBSD 6.1.5 with full installation setting. However, when I run startx it says no screens could be found. So i tried "X -configure" and then "X -config ~/xconfig.conf.new" and I was brought to a very generic screen with a black x crosshair, but I was unable to exit this using the suggested ctrl+alt+backspace, so I had to force power off and check if my keyboard was recognized in the conf file generated, which it was. I have installed xdm, xterm, Xorg, and other X programs.
I am not familiar with setting up desktop environments from scratch. I am a newb who is used to Ubuntu esque installers doing that stuff for me.
Would someone be able to walk me though the installation or point me to a link which explains a step by step process?
What happens if you rename your xorg.conf.new to /etc/X11/xorg.conf? Does startx or xdm work then?
Are you running this inside a VirtualBox or other emulator?
I have NetBSD on a Thinkpad T420 which I occasionally boot into Windows, and I've setup VirtualBox to be able to run the same NetBSD install when I'm in Windows. The key difference in the xorg.conf file is in the Device section:
Section "Device"
Driver "vesa"
EndSection
Also I've found the free version of http://mobaxterm.mobatek.net/ very handy - I use it to ssh into the virtual NetBSD box and then run X apps and have them display on the Windows desktop.
Final note - you might want to look out for the NetBSD-7 RC1 which should be out 'Real Soon Now', as there are some very handy improvements, including better support for most modern display hardware :)
I found that running startx from any directory with a .xinitrc file gives strange behavior in amd64 6.1.5 and 6.1.4. Delete (or rename) any .xinitrc files and try
xinit /path/to/windowmanager
Please read Chapter 9 of NetBSD Guide:
http://www.netbsd.org/docs/guide/en/chap-x.html
Section 9.9 discusses installing various Desktop Managers/Environments.
It turns out that I could run "X -config xorg.conf.new" as root on host and then ssh using putty to manually launch windows.

VirtualBox of 64-Bit Debian Worked Yesterday But Now Cannot Detect 64-Bit CPU

My virtual machine of 64-bit Debian 7.5 (wheezy) was working in VirtualBox 4.3.12r93733 on a Windows 8.1 Pro (64-bit Operating System, x64-based processor: Intel(R) Xeon(R) CPU E5-1620 v2 # 3.70GHz 3.69 GHz) machine (Dell Precision T3610) yesterday. But when I tried it this morning I got an error message saying: 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. I chose to continue but as promised I made it as far as choosing between system modes (regular or recovery) before the screen blacked out.
When I searched this message online I found answers saying to make sure the BIOS had virtualization enabled. My BIOS has 3 options under Virtualization Support: Virtualization, Virtualization for Direct I/O, and Trusted Execution. The first two were enabled but the last was not. (This is a work machine, so I am hesitant to load defaults without speaking to someone from IT first.)
Aside from downloading and initiating an install for Visual Studio Express 2012 (which has since been uninstalled), little has happened on this machine since the Debian virtual machine was last working. So I also investigated and uninstalled the Windows Updates from yesterday on, in case they were involved. (One in particular mentioned having to fix the BIOS.) The ones that were marked important, including the one that fixes BIOS, have been reinstalled.
At this point I started looking into VirtualBox's settings. In my online research I found several forum posts recommended going into Settings->System->Acceleration, a tab that is greyed out for me. While at Settings->System->Motherboard, I noticed my pointing device was set to USB Tablet. When I changed it to PS/2 Mouse and tried the VirtualBox again, the error message went away but the OS still does not successfully boot.
My most recent revelation happened after this: Under Settings->General->Basic, I noticed my version was set to Ubuntu (32 bit), even though I am sure it was at Debian (64 bit) yesterday. But only 32-bit OS's are options, when my machine ought to be capable of having 64-bit ones too.
My question is: What could have caused VirtualBox to lose all 64 bit options, including a working Debian (64 bit), overnight?
You probably have had Hyper-V installed and enabled.
Cross check and Disable the setting from :
Control Panel >> Programs and Features >> Turn Windows features on or off
Reference : https://forums.virtualbox.org/viewtopic.php?f=6&t=57926
try this on virtualbox:
go to your virtual machine setting (right click on VM icon > setting) then go to system > acceleration and ensure that "Enable VT-x/AMD-V" checkbox is checked.

OpenCl: Minimal configuration to work with AMD GPU

Suppose we have AMD GPU (for example Radeon HD 7970) and minimal linux system without X and etc.
What should be installed and what should be launched and how it should be launched to have proper OpenCL environment? In best case it should be headless environment.
Requirements to environment:
GPU visible by OpenCL programs (clinfo for example)
It is possible to monitor temperature and set fan speed (for example using aticonfig).
P.S. Simple install Xserver, catalyst and run X :0 won't work properly. See X server with fglrx driver won't responce after exactly 49 accesses to X server
UPD When you use AMD GPU on linux, OpenCL applications don't see AMD GPU if Xserver isn't launched.
I had similar problem, asked a question and had succeed solving it by myself.
For R9 290 cards and newer i assume you have:
Built kernel 4.14 or later, with amdgpu driver support. There is option in linux kernel config under Graphics Support.
All nesesary firmware .bin blobs are incorporated. To do so easily you may edit buildroot/package/linux-firmware/* contents for buildroot, and manually add BR2_PACKAGE_LINUX_FIRMWARE_AMDGPU option by yourself, along with BR2_PACKAGE_LINUX_FIRMWARE_RADEON (use it as a template). Actually we should post that update to their git.
When booting you should see appropriate dmesg messages about amdgpu initializing, per each adapter. And screen mode should be switched. If you still see large console text and no videomode switch occured during init then you have problem in kernel/firmware, you should fix that out first.
To answer second question, controlling fan speeds/temperatures is achieved via powerplay filesystem, eg /sys/class/drm/.. like this:
cd sys/class/drm/card0/device/hwmon/hwmon0
echo 1 > pwm1_enable
cat pwm1_max > pwm1
You may dig a bit deeper and find powertune parameters nearby, in device folder.
But instead of using /sys/class/drm/card0/device/pp_dpm_sclk i highly recommend flashing that values directly in cards' bios. Set with required frequencies/voltages, as it is more reliable, stable and api independent - you either init it, or not :)
PS. Also put away 7970, buy something a bit newer. I dont know if it is still supported in the latest drivers, we havent such an old card by hands right now. I tested 290, 390, 480, 580 cards series. (for R9 270, miner fails to build cl code). For older cards better to use some older software <=16.40 and maybe a bit older kernel <=4.13

Can I use the Kinect API on a virtual machine?

This programming guide implies that this is possible, so I figure what the heck.
Right now, though, it doesn't work.
Host OS is Vista 64-bit, VMWare Workstation 6.5.3 is running Windows 7 Enterprise 32-bit.
Installed Software on the VM:
Visual C# 2010 Express
Microsoft Server Speech Platform Runtime
Microsoft Server Speech Recognition Language - Kinect
Microsoft Speech Platform SDK
Kinect for Windows SDK Beta
I plug in the Kinect, the device is recognized by the VM, then I run the Sample Shape Game and it doesn't recognize the device. It says "Plug in the Kinect and try again" which turns out to be error 0x80080014, which leads to
http://social.msdn.microsoft.com/Forums/en-US/kinectsdknuiapi/thread/4da8c75e-9aad-4dc3-bd83-d77ab4cd2f82/
which gives me two things to look at:
is it plugged in with the special cable? yes
are all 4 entries in the Device Manager? no
In the Device Manager, I see a "Microsoft Kinect" group containing Microsoft Kinect Audio Control, Microsoft Kinect Camera and Microsoft Kinect Device, but there is nothing under "Sound, video and game controllers" other than VMware VMaudio. "Kinect USB Audio" should be there.
I'm guessing that there is some further twiddling I have to do with the VMWare USB / hardware options (whatever that tray with the USB / CD / HD / floppy etc icons is called) or some deft combination of rebooting and (un)plugging, but I'm almost out of enthusiasm.
Any ideas? TIA
EDIT: I realized that I had some lingering drivers on my host (Vista) system from OpenKinect. After removing them, I can no longer see the Kinect at all in the VM. Hmm.
There is this on read.me
Virtual machines: You must run applications built with the Kinect for Windows SDK Beta in a native Windows environment. Kinect for Windows applications cannot run in a virtual machine, because the Microsoft Kinect drivers and this SDK Beta must be installed on the computer where the application is running.
just to share that (not really understood how) VM Workstation 8 running in a host win 7 x64 with guest OS Ubuntu 10.04 sucessfully detected and installed Kinect drivers.
I was able to test it with libfreenect (OpenKinect Project) http://openkinect.org/wiki/Getting_Started#Manual_Build_on_Linux
best regards,
I'm late to the party, but we've been running and developing for the Kinect with Windows 7 running under VMWare under Mac OS X Mountain Lion.
I'm not a Computer Scientist, but I thought Turing showed that a universal Touring Machine was basically the same as physical hardware. I've had Distributed COM+ running on 3 or 4 VM's on the same physical hardware, but somehow the Kinect device is different? I don't buy that at all.
The most recent version of Microsoft Kinect for Windows (v1.6, possibly slightly earlier versions) in combination with the "Kinect for Windows" hardware does work inside a virtual machine. I run this setup on a MacBook Pro, Parallels 7 and Windows 7.
Note that a Kinect for Xbox does not work inside a virtual machine.
This page from Microsoft says that the "Kinect for Windows" device should work in a VM, but that the "Kinect for XBOX" does NOT work.
First of all you just need two Things to be installed:
libfreenect
libusb
after that you should set three flags to 0x02 at the line
typedef enum {FREENECT_DEVICE_MOTOR = 0x02,FREENECT_DEVICE_CAMERA = 0x02,FREENECT_DEVICE_AUDIO = 0x02,} freenect_device_flags;
Inside the headerfile located at /usr/local/include/libfreenect libfreenect.h but you will lose the ability to control the movement and the the microphone usage will be disabled so don't even try to access them or your device might get damaged after that you should also set
#define PKTS_PER_XFER 32
#define NUM_XFERS 6
inside your libfreenect/src/usb_libusb10.h file at the linux Line
After that rebuild your libfreenect by
mkdir build
cd build cmake ..
make make install.
Than Restart your virtual System and plug and connect only the Kinect Camera Device and no other Kinect device during start of the VM. When System is up you could test your device is properly working by switching to your previously created libfreenect build directory and go to bin there you run ./freenect-camtest you should get no or only a small number of package losses if a lot of losses occur try restart your vm with the camera device pluged in and already connected to your vm. You might need to active disconnect and connect the Webcam from the VM during startup to receive images this should be done during first seconds of VM Boottime!
Works with Ubuntu 14.04 and Workstation 10 and 11 and 11.1
HOST OS Windows 7 and Kinect SDK installed and Kinectdevice for Windows
Also it seems to be quite unstable you often have to restart your virtual system if you can't receive images from your Kinect. But if you once received images don't unplug device or you won't get data until you reboot virtual system with Kinect Camera connected to it.
=> This actually solved the problem otherwise to much frames get lost and its not possible to display proper image!