I have a question of how can we translate the virtual address and get a mapping of that address to the physical memory location.
I have a Windows VM running on Qemu which is hosted on my Ubuntu Linux system. I want to know how can we map programs running on Windows VM to a physical memory location on the host/Linux machine.
How can we do this virtual to physical mapping?
Thanks and advance.
how can we translate the virtual address and get a mapping of that address to the physical memory location.
In windows you can find physical address from virtual using kernel debugger "KD" (part of Windows SDK: https://msdn.microsoft.com/en-us/library/windows/hardware/ff539310(v=vs.85).aspx "Converting Virtual Addresses to Physical Addresses" or http://resources.infosecinstitute.com/translating-virtual-to-physical-address-on-windows-physical-addresses/:
Address Conversion Using !vtop. Suppose you are debugging a target computer on which the MyApp.exe process is running and you want to investigate the virtual address 0x0012F980. Here is the procedure you would use with the !vtop extension to determine the corresponding physical address.
In linux there is /proc/pid/pagemap file (where pid is process ip of target process - you should know that every process has own virtual-to-physical mapping), and there is post about pagemap parsing: http://fivelinesofcode.blogspot.ru/2014/03/how-to-translate-virtual-to-physical.html
I have a Windows VM running on Qemu which is hosted on my Ubuntu Linux system.
In your case there are two nested OS. There is some windows application in Windows OS. Windows OS thinks that it has some physical memory; but in fact it is emulation of physical memory by Qemu emulator.
Qemu is (in simplest non-accelerated case) just one of user application in linux; it has only virtual memory from Linux. So, memory which is emulated for Windows as physical (guest-physical) is actually host-virtual (but it is not 1-to-1 mapping, there is also qemu translation with some "memory-backend", which probably maps huge regions of guest-physical to host-virtual -http://blog.vmsplice.net/2016/01/qemu-internals-how-guest-physical-ram.html; check also Print range of memory addresses in qemu).
I want to know how can we map programs running on Windows VM to a physical memory location on the host/Linux machine.
Use Windows KD debugger to convert guest-virtual address from inner program to guest-physical address. Then use qemu command line to find, how qemu mapped guest-physical to virtual memory of qemu process (to host-virtual), get host-virtual address and convert it to host-physical with pagemap special file from
/proc/`pidof qemu-system-x86_64`/pagemap
Related
Recently I have a framework which can run in Linux only, but I am used to work on windows.I know that Nvidia-docker doesn't support windows, so I have to choose install double system in one host or use a virtual machine allocated as Linux.Maybe I prefer the latter.So I want to know if the virtual machine can use GPU in host or in workstation? What should I do to solve this problem? Better method hoped! Thanks!
For VMWare: https://www.dell.com/support/article/en-us/sln288103/how-to-enable-a-vmware-virtual-machine-for-gpu-pass-through?lang=en
And Hyper-V also can pasthrough GPU: https://social.technet.microsoft.com/Forums/en-US/b9e21b8f-8774-49c2-b499-b2b8ff2a41a2/hyperv-windows-10-pci-passthrough?forum=win10itprovirt
I have constructed a machine-learning computer with two RTX 2070 SUPER NVIDIA GPUs connected with SLI Bridge, Windows OS (SLI verified in NVIDIA Control Panel).
I have benchmarked the system using http://ai-benchmark.com/alpha and got impressive results.
In order to take the best advantage of libraries that use the GPU for scientific tasks (cuDF) I have created a TensorFlow Linux container:
https://www.tensorflow.org/install/docker
using “latest-gpu-py3-jupyter” tag.
I have then connected PyCharm to this container and configured its interpreter as an interpreter of the same project (I mounted the host project folder in the container).
When I run the same benchmark on the container, I get the error:
tensorflow.python.framework.errors_impl.ResourceExhaustedError: OOM when allocating tensor with shape[50,56,56,144] and type float on /job:localhost/replica:0/task:0/device:CPU:0 by allocator cpu
[[node MobilenetV2/expanded_conv_2/depthwise/BatchNorm/FusedBatchNorm (defined at usr/local/lib/python3.6/dist-packages/ai_benchmark/utils.py:238) ]]
Hint: If you want to see a list of allocated tensors when OOM happens, add report_tensor_allocations_upon_oom to RunOptions for current allocation info.
This error relates to the exhaustion of GPU memory inside the container.
Why is the GPU on the windows host successfully handle the computation and the GPU on the Linux container exhaust the memory?
What makes this difference? is that related to memory allocation in the container?
Here is an awesome link from docker.com that explains why your desired workflow won't work. It also wouldn't work with RAPIDS cudf either. Docker Desktop works using Hyper V which isolates the hardware and doesn't access to the GPU the way the Linux drivers expect. Also, nvidia-docker is linux only
I can let you know that RAPIDS (cudf) currently doesn't support this implementation either. Windows, however, does work better with a Linux host. For both tensorflow and cudf, I strongly recommend that you use (or dual boot) one of the recommended OSes as your host OS, found here: https://rapids.ai/start.html#prerequisites. If you need Windows in your workflow, you can run it on top of your Linux host.
There is a chance that in the future, a WSL version will allow you to run RAPIDS on Windows, letting you- on your own- craft an on Windows solution.
Hope this helps!
Hi guys my problem is as follows:
Environment - Im in a windows machine and connected via ssh to an ubuntu machine that is running a hypervisor https://github.com/siemens/jailhouse alongside ubuntu.
Problem:
The hypervisor in question dumps debug and "cell"(like guest VM's but not quite) outputs to a serial port, and the physical machine that is running the hypervisor lacks a serial port.
What I need to know if it is possible:
I wish to redirect that serial output to SSH back to me or dump to a file that I can "nano" later.
Thanks in advance
Regards
André Santos
You can't. The reason is that the output is written by the hypervisor, not by the operating system, through a specific serial driver implemented in the hypervisor itself.
Thus, the hypervisor does not have knowledge of the Linux filesystem, nor of the Linux drivers, and the only channels that it can use are a 8250-compliant serial line or (in case of x86) the VGA.
Side note: depending on your particular needs, you may want to wrap the Jailhoused Linux through an additional Qemu/KVM virtual machine. In this case, the output of Jailhouse (exceuted by the guest machine) is written on the console of the host machine, and it can be easily retrievable through the SSH connection.
I am working on xen hypervisor. Because of working below OS.The things I can see is physical devices such as cpu and memory.The Guest OS is HVM(windows 7).I need to copy it memory of kernel space(above 0x80000000).It works all right when copy below 0x80000000. But the win7 oops when I copy from above 0x80000000. I think the cpu is running on ring3 when I copy.But I need to know which level(ring0 or ring3) the vcpu of Guest OS is running on.(I use hvm_copy_from_guest_phys() in win7's context to do the copy operation)
Answer using Delphi preferred but any solution would be helpful.
What I'd like to do is to create an app that when run from within VMPlayer will create a shared folder to a known location on the host.
The VMPlayer will be running Windows XP 32bit, the host running a Windows OS as well probably Windows 7 x64.
There is vmrun.exe utility that can be used to control VM. Look at:
http://www.vmware.com/support/developer/vix-api/vix110_vmrun_command.pdf
You need to think of your VMPlayer virtualized hardware as an independent computer, running it's own independent operating on it's own hardware. That's the way virtualization works!
Technically the HOST doesn't even know it's "running" the other computer, so it's not going to treat it differently. The same is true for the GUEST operating system: you are running a "vanila" operating system, it has no reason to treat it's HOST computer differently, to the GUST the HOST is just an other computer accessible through the local network.
That being said, you can re-write your question like this:
I'd like to create an app that when run from one computer will create a shared folder to a known location on an other computer. One computer would be running Windows XP 32 bit, the other would be running an other version of Windows, probably Windows 7 x64
The answer: Of course you can't do that: it would create a security breach! If you're able to create the shared folder, anyone's able to create a shared folder. Anyone could create a shared folder to any location on your machine!
To wrap this up, if you could run your application on the HOST, not the GUEST, you might be able to use VmWare API to do something, but AFAIK the API is not available with the free VmPlayer. Also, if you could run applications on both guest and host you'd be able to do whatever you want.