[Qemu-discuss] VNC port conflict

2017-01-22 Thread Mahmood Naderan
Hi,
Recently, as I run the qemu command to bring up windows guest, it
aborts with a vnc error

$ qemu -m 3000 -cpu Opteron_G5 -hda qemu-vm/win2xpsp3_32_c.img -hdb
qemu-vm/win2xpsp3_32_d.img -boot c  -usbdevice tablet -enable-kvm
-device e1000,netdev=host_files -netdev
user,net=10.0.2.0/24,id=host_files,restrict=off,smb=/home/mahmood,smbserver=10.0.2.4
-vnc :1
qemu: -vnc :1: Failed to start VNC server: Failed to bind socket:
Address already in use

It seems that another user is using his own guest with vnc :1

saremi   31191  5.4  4.7 3624016 3133112 pts/31 Sl+ 12:00  14:10 qemu
-m 3000 -cpu Opteron_G5 -hda qemu-vm/win2xpsp3_32_c.img -hdb
qemu-vm/win2xpsp3_32_d.img -boot c -usbdevice tablet -enable-kvm
-device e1000,netdev=host_files -netdev
user,net=10.0.2.0/24,id=host_files,restrict=off,smb=/home/saremi,smbserver=10.0.2.4
-vnc :1


The same error exists for :2 but :3 is free.
That mean, I have to ask all users which port they are using. Any idea?
-- 
Regards,
Mahmood



Re: [Qemu-discuss] VNC port conflict

2017-01-22 Thread akhilesh rawat
you can run ps -eaf |grep vnc to see whcih all ports being reserved . or
netstat comand netstat -tln|grep :59

On Sun, Jan 22, 2017 at 6:21 PM, Mahmood Naderan 
wrote:

> Hi,
> Recently, as I run the qemu command to bring up windows guest, it
> aborts with a vnc error
>
> $ qemu -m 3000 -cpu Opteron_G5 -hda qemu-vm/win2xpsp3_32_c.img -hdb
> qemu-vm/win2xpsp3_32_d.img -boot c  -usbdevice tablet -enable-kvm
> -device e1000,netdev=host_files -netdev
> user,net=10.0.2.0/24,id=host_files,restrict=off,smb=/home/
> mahmood,smbserver=10.0.2.4
> -vnc :1
> qemu: -vnc :1: Failed to start VNC server: Failed to bind socket:
> Address already in use
>
> It seems that another user is using his own guest with vnc :1
>
> saremi   31191  5.4  4.7 3624016 3133112 pts/31 Sl+ 12:00  14:10 qemu
> -m 3000 -cpu Opteron_G5 -hda qemu-vm/win2xpsp3_32_c.img -hdb
> qemu-vm/win2xpsp3_32_d.img -boot c -usbdevice tablet -enable-kvm
> -device e1000,netdev=host_files -netdev
> user,net=10.0.2.0/24,id=host_files,restrict=off,smb=/home/
> saremi,smbserver=10.0.2.4
> -vnc :1
>
>
> The same error exists for :2 but :3 is free.
> That mean, I have to ask all users which port they are using. Any idea?
> --
> Regards,
> Mahmood
>
>


Re: [Qemu-discuss] VNC port conflict

2017-01-22 Thread Mahmood Naderan
>you can run ps -eaf |grep vnc to see whcih all ports being reserved

Isn't there any easier way? Users are not expert, so do not expect to use
ps command and see which vnc port is free...

If I don't use vnc, the qemu will bring up the screen. So, the question is
what is the benefit of using vnc? Bu using vnc, I have to open another
terminal and connect to the guest

Regards,
Mahmood


Re: [Qemu-discuss] VNC port conflict

2017-01-22 Thread Donald R Laster Jr

This is how I addressed the need to try and select unique ports for the VNC and 
Spice environments.  This is from a Bash script used to start each VM.

#=#
# Spice and VNC Settings  #
# #
# For each setting use the last octet of the primary MAC/IP Address in#
# decimal notation plus the port settings as the default setting.  Thus for a #
# MAC/IP Address of 52:54:00:10:01:05/172.16.1.5 the settings would be:   #
# #
#Spice Port (SPICEP)  : 4 + (octet5*256) + octet6 #
#VNC Port :  5900 + octet6#
# #
# The octets converted to decimal notation.   #
# #
#=#

 if [ "${MACADR[ 0]}" != "" ] ; then

SAV="${IFS}"
IFS="${IFS}:"
get_mac_as_decimal 1 ${MACADR[ 0]} 
OCTET1=$?
get_mac_as_decimal 2 ${MACADR[ 0]} 
OCTET2=$?
get_mac_as_decimal 3 ${MACADR[ 0]} 
OCTET3=$?
get_mac_as_decimal 4 ${MACADR[ 0]} 
OCTET4=$?
get_mac_as_decimal 5 ${MACADR[ 0]} 
OCTET5=$?
get_mac_as_decimal 6 ${MACADR[ 0]} 
OCTET6=$?
IFS="${SAV}"

OCTET5=$((${OCTET5}*256))

SPICEP=$((4+${OCTET5}+${OCTET6}))
VNCHOST=":${OCTET6}"  # Format is [host][:display]
MONPIPE="/tmp/.qemu_control_${SPICEP}"# Monitor Pipe

SPICEINFO="-spice port=${SPICEP},password=isrdesk"
VNCINFO="-vnc ${VNCHOST}"
QMPINFO="-qmp unix:${MONPIPE},server,nowait"

 else

echo "MAC Address 0 is not defined.  Spice Port, VNC Host and Monitor Pipe"
echo "can not be set.  Empty values are being set."

SPICEP=""
VNCHOST=""
MONPIPE=""

SPICEINFO=""
VNCINFO=""
QMPINFO=""

 fi

Don

Mahmood Naderan wrote on 01/22/2017 08:23 AM:
>>you can run ps -eaf |grep vnc to see whcih all ports being reserved
> 
> Isn't there any easier way? Users are not expert, so do not expect to use ps 
> command and see which vnc port is free...
> 
> If I don't use vnc, the qemu will bring up the screen. So, the question is 
> what is the benefit of using vnc? Bu using vnc, I have to open another 
> terminal and connect to the guest
> 
> Regards,
> Mahmood
> 



[Qemu-discuss] WinXP Guest: New hardware found - VGA controller

2017-01-22 Thread Joe
I'm trying Qemu (2.8.0) on Slackware GNU Linux 14.2 (64-bit) host.
I've a Windows XP (guest) raw image which was working with Qemu times ago
(I used it on an older Slackware version as host system).

Now I launch qemu with the following command:
-
qemu-system-i386 \
   -m 2G \
   -net nic,model=rtl8139 \
   -net user,smb=/mnt/share \
   -drive file=newXP-15G.img,format=raw,index=0,media=disk \
   -drive file=/tmp/ramdisk/ntfs-ramdisk-300M,format=raw,index=1,media=disk
\
   -enable-kvm
-

The system boots up regularly, but when it has almost complete, a "New
Hardware found" pops up and it offer a search for the proper driver, then
it doesn't find anything.
If I look at Windows XP "device manager" I can see a yellow question mark
on a device: "Video Controller (VGA Compatible)".

If I well understood by reading Qemu man page, the default video card
emulated should be a Cirrus model and it should be recognized by XP. Anyway
I tried also to add:

-vga std

But also this time It can't be managed by any driver and device manager
reports the yellow question mark also this time.

Any suggest to solve?
Thank you in advance folks!   :)


[Qemu-discuss] Antw: Re: VNC port conflict

2017-01-22 Thread Steffen Weißgerber
Hi,

the vnc option can handle the port dynamicaly with -vnc :0,to=x where the
next open port is used from 5900 on to 5900+x.

You then can get the used port via monitor command info vnc or assign it to a 
variable

 VNC_PORT=$(echo "info vnc" | socat - UNIX-CONNECT:${FILE_MONITOR} | grep 
address | head -1 | cut -d\: -f 3 | tr -d '\r')

for further use.

Steffen


>>> Donald R Laster Jr  22.01.2017 23:10 >>>

This is how I addressed the need to try and select unique ports for the VNC and 
Spice environments.  This is from a Bash script used to start each VM.

#=#
# Spice and VNC Settings  #
# #
# For each setting use the last octet of the primary MAC/IP Address in#
# decimal notation plus the port settings as the default setting.  Thus for a #
# MAC/IP Address of 52:54:00:10:01:05/172.16.1.5 the settings would be:   #
# #
#Spice Port (SPICEP)  : 4 + (octet5*256) + octet6 #
#VNC Port :  5900 + octet6#
# #
# The octets converted to decimal notation.   #
# #
#=#

 if [ "${MACADR[ 0]}" != "" ] ; then

SAV="${IFS}"
IFS="${IFS}:"
get_mac_as_decimal 1 ${MACADR[ 0]} 
OCTET1=$?
get_mac_as_decimal 2 ${MACADR[ 0]} 
OCTET2=$?
get_mac_as_decimal 3 ${MACADR[ 0]} 
OCTET3=$?
get_mac_as_decimal 4 ${MACADR[ 0]} 
OCTET4=$?
get_mac_as_decimal 5 ${MACADR[ 0]} 
OCTET5=$?
get_mac_as_decimal 6 ${MACADR[ 0]} 
OCTET6=$?
IFS="${SAV}"

OCTET5=$((${OCTET5}*256))

SPICEP=$((4+${OCTET5}+${OCTET6}))
VNCHOST=":${OCTET6}"  # Format is [host][:display]
MONPIPE="/tmp/.qemu_control_${SPICEP}"# Monitor Pipe

SPICEINFO="-spice port=${SPICEP},password=isrdesk"
VNCINFO="-vnc ${VNCHOST}"
QMPINFO="-qmp unix:${MONPIPE},server,nowait"

 else

echo "MAC Address 0 is not defined.  Spice Port, VNC Host and Monitor Pipe"
echo "can not be set.  Empty values are being set."

SPICEP=""
VNCHOST=""
MONPIPE=""

SPICEINFO=""
VNCINFO=""
QMPINFO=""

 fi

Don

Mahmood Naderan wrote on 01/22/2017 08:23 AM:
>>you can run ps -eaf |grep vnc to see whcih all ports being reserved
> 
> Isn't there any easier way? Users are not expert, so do not expect to use ps 
> command and see which vnc port is free...
> 
> If I don't use vnc, the qemu will bring up the screen. So, the question is 
> what is the benefit of using vnc? Bu using vnc, I have to open another 
> terminal and connect to the guest
> 
> Regards,
> Mahmood
> 




--
Klinik-Service Neubrandenburg GmbH
Allendestr. 30, 17036 Neubrandenburg
Amtsgericht Neubrandenburg, HRB 2457
Geschaeftsfuehrerin: Gudrun Kappich



Re: [Qemu-discuss] VNC port conflict

2017-01-22 Thread Mahmood Naderan
​Thanks for the suggestions. I will try them.

Regards,
Mahmood