Emulator Running in Nested Virtualization - android-studio

The emulator is running using nested virtualization. This is not recommended. It may not work at all. And typically the performance is not quite good.
VM machine(Window10)

Related

android emulator low performance with multicore cpus on linux server

when I start the emulator I get a message:
emulator: WARNING: Not all modern X86 virtualization features supported, which introduces problems with slowdown when running Android on multicore vCPUs. Setting AVD to run with 1 vCPU core only.
the server is quite productive, has 6 cores with 2 threads. Sufficient amount of RAM.
I installed everything necessary on the similarity of kvm and etc.
I use intel-atom-x86 os27api.
But this message still doesn't disappear. And this seems to have a strong impact on the performance of emulators.
And the load average in top rises above 12.0
the ci structure is constructed as follows:
gitlab-runner { docker { project, android-sdk+emulator } }
I understand that need to limit the use of only one core for one emulator.
Is there any way to solve this?
P.S. emulators run and work, but CI tests often crash. (everything is fine locally on the computer).
running 3 emulators
I was able to reduce the server load by specifying --device when creating the emulator.
I use — 5.4in FWVGA
for all 4 emulators. And after that, load Average I stable get a value of 4-6, instead of 12 as before.
The warning didn't disappear.
This is enough for me) but I also look forward to any suggestions for solving the problem.

Is running a Linux container on windows AWS instance possible?

I'm trying to run a Linux (ubuntu LTS) container inside a windows server 2019 OS. The problem is that the windows OS runs as an AWS instance.
There have been problem for me trying to achieve this and I've been reading somewhat different opinions on the internet regarding whether or not it is possible. Some say it will be possible on a .metal instance which is bare metal. Currently I've been trying running it on a regular t3 instance with has virtualization type HVM.
To sum up my questions are:
Is running a linux container on windows aws instance possible?
If yes, how?
If not, will it be possible on a bare metal instance?
Please keep in mind that I need the container to run in a Windows environment due to multiple tasks the the OS needs to achieve (and I don't want multiple instances)
In order to use Docker Desktop on Windows, you need either Hyper-V or Windows Susbsystem for Linux enabled (which at its turn requires Hyper-V). Both solutions demand of VT-x capabilities, but you're running inside a VM, which means that is not so easy to achieve.
It is called "nested virtualization", and it is not supported in common EC2 virtual machines. (source)
You can certainly run Linux containers on a bare metal Windows instance (but why you should? it is way cheaper and simpler to create a Linux virtual machine on EC2 and communicate it with your Windows host). Should still that be your purpose, you can install Windows Server 2019 with Hyper-V. (tutorial)
Another alternative for SMALL, SMALL things, that could work without nested virtualization (I haven't tried), would be using WSL1. (more info)
WSL1 uses a compatibility layer between Windows and Linux system calls, without actually virtualizing the operating system. Some folks have been able to install Docker 17.09 on WSL1, but this is a very adventurous path I would not recommend taking.

How can I write CUDA in Visual Studio on Windows and deploy it to Linux?

I'm assisting a professor in setting up a lab for a class in parallel programming. The process will be the following:
A student logs into a virtual machine running Windows 7. This machine has no GPUs available. It has version 7.5 of the CUDA toolkit installed along with Visual Studio 2013. Students are supposed to use Visual Studio to write their CUDA programs/projects.
To test/run these projects, students have remote access to a fairly high-end machine. I don't have physical access to it, but from what I can tell using the command line, it has four NVIDIA Tesla M40s. Students have remote access to this machine via SSH. The issue, though, is that this machine is running Linux (Ubuntu 14.04.5). I'm trying to figure out how to deploy what students write in Visual Studio on Windows to the Linux box with the GPUs. I have limited experience in C, C++, and CUDA. I can work my way around a make file, but specific instructions on this topic (if it's part of the solution) would be appreciated.
I have read this article—Creating CUDA Projects for Linux—which details how to get NVIDIA's sample projects running, but I'm not sure if I can adapt this to work in the given situation.
I'm looking for a simple way for students to write assignments in CUDA, but they also need to be able to run what they write. The reason that this professor and I prefer Visual Studio are:
It's something many students in this class are familiar with
It handles project architecture fairly well
It offers students a GUI which can help reduce the learning curve (students can focus on CUDA instead of terminal, gcc, etc.—these things are undeniably incredibly useful, but they're not the focus of the class)
If the test machine were running Windows, then students would be able to simply transfer the contents of the debug or release folder for their solutions in Visual Studio (on the development VM) to the test machine and then run the executable. Since there are two different operating systems in play, I don't imagine it will work like this. I know that writing code on Windows and deploying on Linux won't be quite as easy, but I'm hoping there's a feasible solution.
Reconfiguring the setup and having students develop directly on the test machine or creating a Linux VM for development is doable, but should be avoided if at all possible. Reconfiguration would require involving the systems admin team and would delay the process of getting students writing code.
I have researched this and I've come across these questions, but they don't quite apply to this specific case:
How to write programs in C# .NET, to run them on Linux/Wine/Mono?
How should I develop CUDA on OSX and the deploy test on Linux
The direct answer to the question is that it is not really practical to try to take a VS solution/project and reconstruct it in linux. It may be possible, but I wouldn't put that burden on students trying to learn GPU programming.
An alternative would be to have your students use an X-forwarding SSH client such as Mobaxterm or else a remoting solution like TightVNC from the windows box (VM) to the linux box where the GPUs are. There are some nuanced differences between these two approaches. I believe the X-forwarded SSH client approach will have somewhat lighter network load and does not actually require an X-desktop to be running on the target, whereas TightVNC is an actual remote desktop solution. Therefore the user experience may be somewhat different for these two approaches, however if all the machines in question (windows VMs, linux GPU box(es)) have 100Mb or faster networking between them, and you're only running a few clients at a time, I think it may not matter much.
Either solution will probably work best if you establish individual user accounts on the linux box for each student/client.
And since the students will be sharing the GPU resources, if multiple students are trying to run projects simultaneously, there could be issues, but probably not a problem for introductory level programming work.
Once they have made a connection, the students can then launch nsight to run the linux-based GUI IDE (nsight Eclipse Edition) to build CUDA projects, and run/debug/profile them.

Confusion regarding emulator and simulator?

My head was bursting about the difference of emulator and simulator since some days.So i started to find out what they are.But i got some answers which are very contrasting.Somewhere i saw:
The Simulator tries to duplicate the behavior of the device.
The Emulator tries to duplicate the inner workings of the device.
and in another resource i saw:
The goal of an emulation is to able to substitute for the object it is emulating.
A simulation’s focus is more on the modelling of the internal state of the target
I am really a bit confused???
Emulator
Reproduce the precise behaviour of a system, generally all the way down to the hardware level. So, for example, the Android emulator pretends to be an actual ARM device, with virtualized hardware and a virtual ARM CPU. This provides the best realism and can run native ARM code, but often at a heavy speed penalty. The emulated environment is supposed to be so close to the real thing (modulo the slow speed) that it can substitute for the real thing in a lot of cases.
Another example of an emulator is most virtual machine software, which aims to provide a complete emulated computer system to run an operating system.
Simulator
Simulate the behaviour of a target system by recreating its details at a higher level, e.g. by recompiling the OS or program for a new CPU and connecting it directly to the real hardware (instead of using emulated hardware). This is faster, but less accurate because it does not replicate the behaviour of the actual hardware. For example, the iOS simulator runs a subset of iOS, ported to x86. It can't run native ARM code, nor can it replicate hardware quirks unique to real iOS devices.

Running VMware in VMware?

We have a physical machine that runs VMware and hosts a VM we use for SharePoint deployment testing. That machine is old and dying, and my employer's network czars are heavily pushing hosted VMs as a replacement for outdated physical servers. I was curious about whether it's possible to run VMware inside VMware, and if so, whether there are severe performance implications. We don't require extreme performance from this setup, since it's just used for SharePoint testing and the associated SQL Server is on a different box. My guess is that we can't just use the primary hosted VM for our testing because we'll want to roll back occasionally and otherwise have more control over it, and getting buy-in for that from the network folks is unlikely. Does anyone have any experience with this?
edit: I know this nesting certainly isn't the preferred option, but (1) we want the flexibility of being able to use VMware snapshots at will and (2) the network folks will not allow us to arbitrarily roll back to a previous point in time because of the potential for removing mandated security updates. My guess is that a local desktop machine running VMware Workstation might just be the way to go. The hosted option seems attractive if it will work though since it's less machine maintenance for me to deal with.
The technical limitation with running VMware inside VMware is that VMware, Virtual PC, etc takes advantage of the Virtualization features present in modern CPUs.
If you have two or more hypervisors are both trying to control Ring 0 then there will be problems, this is something that I've encountered while trying to run both VMware and Virtual PC simultaneously on my desktop - one will error out/crash.
If your hypervisor can interact with the 'parent' hypervisor, then you'll be OK. Alternatively if the child hypervisor doesn't try to use the CPU virtualization features, or entirely emulates the CPU (such as QEMU) then you should also be OK.
Basically old-style hypervisors on old CPUs use Full virtualization (slow) which would be capable of nesting with a heavy, heavy performance hit. modern Hypervisors/CPUs use hardware assisted virtualization (near native performance) and you'd be hard pressed to find a hypervisor that is designed or capable of nested virtual machines.
Finally, I'd really advise against running dev/test VMs on the same physical server that is running production VMs. There's just too much to go wrong and security implications - you need to manage the dev/test environment and it sounds like you shouldn't have access to production environment. Likewise you probably don't want the operations team messing about with your test environment.
UPDATE: ESXi 4 now supports virtualizing itself. See this article for more information
I've never run VMware in VMware, but I've run VirtualPC inside VirtualBox without problems, so there's no fundamental reason it shouldn't work I suppose...
It sounds to me more like you have a problem with the inflexibility of your "network czars" than any technical one. If you're a developer or QA you need a testing environment where you can fool around with outdated (and potentially insecure) versions of the OS and applications, without putting the rest of the company network at risk.
Ex-VMware employee here.
Firstly, when you say Nested VMware I will assume you mean Nested ESXi. (You could also mean Workstation, Fusion, or Player).
Nested ESXi environments are unsupported and should not be used for production. These scenarios are not tested in QA and not guaranteed to work. In short, if you experience any kind of problem, VMware will not help you with this Nested ESXi setup.
With that said, yes you can do it and yes it does work. A lot of people use nested ESXi in their labs but not in production. Previously there were special configuration file edits that were necessary for nested ESXi to work. I have seen environments with even 3 layer nested ESXi servers (ESXi vm on and ESXi vm on a physical ESXi host). More recently there is the ESXi appliance which makes this much easier.
Have a look here:
http://www.virtuallyghetto.com/2015/12/deploying-nested-esxi-is-even-easier-now-with-the-esxi-virtual-appliance.html
I ran into this same problem. I work at a large company where our entire infrastructure is virtual, so if you need a server you get a VMware VM. So I had a couple of Windows 2003 Server Standard Edition based Guest VM's that had 6GB of memory and 200 GB of disk space, but I wanted to run linux and a LAMP stack on them. So I tried to install VMware Workstation on one and I got an error message saying it couldn't be installed within a VM. I also tried Microsoft Virtual PC and got a similar error message. I installed Sun's VirtualBox and that installed fine, but I couldn't get the networking to work w/in the guest Ubuntu OS. My next step is to try QEMU although performance might become an issue.
You ought to have a look at Mainframes - they are Virtualised from the word go:
Hardware - runs Hypervisor Type 1 - Level 1
on this you have zVM - Type 2 Hypervisor - Level 2
on this you have zOS - your main big operating system - Level 3
and/or
on this you have zLinux - Level 3
and/or
on this you have zVM for testing next version - Level 3
and/
on this you have zOS for testing zVM plus zOS both at next version - Level 4
So going down to level 4 is pretty common
Mind you on a Mainframe you can have 1000's of VMs running at the same time - and most sites who start using zVM/CMS and zVM/Linux usually do.
I can see two solutions for this (three if you count a VM inside a VM which is just crazy).
New hardware, which should be robust enough to handle several VM's used specifically for testing (sharpoint, etc.). In this situation your team could be given more rights without affecting non-testing VM's.
Sharepoint test VM's are moved to the main VM pool and those who need access are given the ability to checkout/deploy/rollback testing resources. This could be direct through VMWare tools or through an internal project that works through a VMWare API.
This should be a joint decision between Network/Dev/Testing.
JFYI:
I tried installing and running VMware ESXi server host(child ESXi server) as a virtual machine(on parent ESXi server) and it runs however you can not run any VMs under child ESXi server.
I am doing practice of VMware vSphere Data center virtualization on single Physical machine. There is VMware Workstation installed on Windows 8 OS. In VM Workstation, I have installed Windows Server 2008 OS, VMware ESXi OS and created the VMware Data center LAB. There is VMs running in LAB, and its confirm that We can user VMware in VMware. But it depends on your need, and Products which is chosen.
You can install ESXi on VMware Workstation, it's usefull to learn ESXi, so there in no reason run VMware in VMware.
Yes. You can run VMWare inside VMWare. Though its not officially supported, You can deploy VMs in the child ESX. I have checked for an advanced feature like PassThrough the HBA card but which was not available in child ESX, hence I could not provide a LUN from array.
So in production its better to not use this.
But for training and practices this can be used.
You can do that.
You can install vmware esxi inside virtual machine of another vmware esxi.
But the performance will be very bad.
Totally works.. totally can't do it other then for some kinda testing or some kind of educational purpose, because you won't get support. and from my limited experience it doesn't perform that well.
Yes, you can, VMware can even detect if it's running inside of another vmware machine and warn you that VMception will cause worse performance. which it will, trust me, just try to get the version the virtual machines work best in a physical machine, as to get as much performance possible.
"whether it's possible to run VMware inside VMware" What?
I can run Windows with Sharepoint in a VMWare machine that's hosted somewhere.
Or, I can run Windows with Sharepoint in a WMWare machine that's actually a VMWare machine that's hosted somewhere.
Why on earth would I add a level of nesting? Why not just go with Windows with Sharepoint hosted somewhere?
You can have any number of VMWares running on a single host. Lots of different versions doing lots of different things.
Nesting them doesn't make sense.

Resources