Why would you use the ternary operator without assigning a value for the “true” condition (x = x ?: 1)

This is permitted in GNU as an obscure extension to C 5.7 Conditionals with Omitted Operands The middle operand in a conditional expression may be omitted. Then if the first operand is nonzero, its value is the value of the conditional expression. Therefore, the expression x ? : y has the value of x if … Read more

How to use qemu to run a non-gui OS on the terminal?

You can compile qemu for youself and install it into your home directory. There will be no kernel-mode qemu accelerator, but the qemu will work and the speed will be rather high. Qemu has two options for non-gui start: http://wiki.qemu.org/download/qemu-doc.html 2.3.4 Display options: -nographic Normally, QEMU uses SDL to display the VGA output. With this … Read more

How to convert flat raw disk image to vmdk for virtualbox or vmplayer?

First, install QEMU. On Debian-based distributions like Ubuntu, run: $ apt-get install qemu Then run the following command: $ qemu-img convert -O vmdk imagefile.dd vmdkname.vmdk I’m assuming a flat disk image is a dd-style image. The convert operation also handles numerous other formats. For more information about the qemu-img command, see the output of $ … Read more

What’s the differences between Xen, QEMU and KVM?

QEMU is a powerful emulator, which means that it can emulate a variety of processor types. Xen uses QEMU for HVM guests, more specifically for the HVM guest’s device model. The Xen-specific QEMU is called qemu-dm (short for QEMU device model) QEMU uses emulation; KVM uses processor extensions (HVM) for virtualization. Both Xen and KVM … Read more

Solidworks: activation license mode is not supported in this virtual environment (Qemu-KVM)

Most current hypervisors that run on Intel hardware use CPUID leaves 0x40000000 et seq. to pass information about the hypervisor from host to guest. KVM, Xen, VMware and Hyper-V all use this method. This is in addition to the hypervisor feature flag set in CPUID leaf 0x1, which indicates that the machine is a virtual … Read more

What are the differences between QEMU and VirtualBox? [closed]

Basically both have features which the other does not have, so this might ease the decision. QEMU/KVM is better integrated in Linux, has a smaller footprint and should therefore be faster. VirtualBox is a virtualization software limited to x86 and amd64 architecture. Xen uses QEMU for the hardware assisted virtualization, but can also paravirtualize guests … Read more

QEMU multiple port forwarding

Got it to work: with -net: qemu-system-i386 -net nic,model=rtl8139 \ -net user,hostfwd=tcp::3389-:3389,hostfwd=tcp::443-:443,hostfwd=tcp::992-:992 \ -m 512M -localtime -cpu core2duo,+nx -smp 2 -usbdevice tablet \ -k en-us -hda win.img -nographic Original answer: redir (legacy) qemu-system-i386 -net nic,model=rtl8139 \ -net user,hostfwd=tcp::3389-:3389 \ -redir tcp:443::443 -redir tcp:992::992 \ -redir tcp:5555::5555 -redir udp:1194::1194 -redir udp:500::500 \ -redir udp:4500::4500 \ -m … Read more