大网数据广告活动
服务器运维问答

KVM hypervisor - Windows 32bit VM, RAM up to 2GB usable

· 52CE 我爱测

I've got a Debian 10 KVM hypervisor, no libvirt or other tool to administrate it, using QEMU scripts. I need a 32bit Windows VM for a legacy app, but on a supported OS (not XP), either Windows 8.1 or 10 32bit. Both Windows 8.1 & …

问题原文

原帖链接 · Krackout · CC BY-SA 4.0

I've got a Debian 10 KVM hypervisor, no libvirt or other tool to administrate it, using QEMU scripts. I need a 32bit Windows VM for a legacy app, but on a supported OS (not XP), either Windows 8.1 or 10 32bit. Both Windows 8.1 & 10 present a message «2GB usable» on system properties when 3GB RAM is assigned (the max capable of handling for a 32 bit machine without other techniques I suppose). On the contrary Win XP seems to use 3GB RAM, stating PAE enabled.

Any ideas how to use 3GB RAM on Win 8.1 or 10, 32 bit?


Here's the screenshot of Win 8.1 VM with 3GB RAM (some on Win 10):


Here is the QEMU script to start the VM (I've also tried host CPU, no difference):

#!/bin/sh
SPICE_PORT=3010
MONITOR_PORT=2330
QEMU_AUDIO_DRV=alsa

kvm \
    -M q35 \
    -nodefaults \
    -cpu qemu64 \
`#  -cpu host` \
    -m 3G \
    -mem-path /dev/hugepages \
    -device virtio-balloon-pci \
    -rtc base=localtime \
    -vga qxl \
    -drive file=win8.qcow2,if=virtio,cache-size=16M,cache=writethrough \
    -device virtio-net-pci,netdev=diktyo0 \
    -netdev user,id=diktyo0 \
    -monitor telnet:localhost:${MONITOR_PORT},server,nowait \
    -device virtio-serial \
    -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 \
    -chardev spicevmc,id=vdagent,debug=0,name=vdagent \
    -spice port=${SPICE_PORT},addr=127.0.0.1,disable-ticketing \
    -device virtserialport,chardev=charchannel1,id=channel1,name=org.spice-space.webdav.0 \
    -chardev spiceport,name=org.spice-space.webdav.0,id=charchannel1 \
    -soundhw ac97 \
    -name "Windows 8.1 x86" \
    -daemonize \

Following shodanshok's advice, I post resource monitor's output (with 4GB total RAM):

Half the memory is reserved by hardware.

I've also increased RAM to 4GB:

Just in case of QXL video driver reserving too much memory, I also changed the line configuring video to:

-device qxl-vga,vgamem_mb=64,ram_size_mb=64,vram_size_mb=64

I may try to change the Seabios, at least the version. Unfortunately in Debian Stable QEMU version is 3.1.0; it's quite old, I wonder if the same behaviour appears in newer versions.

已采纳解答

原帖链接 · shodanshok · CC BY-SA 4.0

UPDATED ANSWER: as shown in the comments and the updated question, the specific issue was related to a 2 GB hardware memory reservation due to the specific machine type. Switching to an i440fx machine type solved the issue.

ORIGINAL ANSWER (left here because it can help others with similar issues on 32 bit Windows):

Try increasing the user-space memory allocation by using the following command (and rebooting):

bcdedit /set IncreaseUserVa 3072

Please be sure to snapshot you VM before executing the command above (and be sure to have a valid backup).

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-11-21)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。