Bug 180086 - emulators/virtualbox-ose: Can't select amount of RAM for virtual machine
Summary: emulators/virtualbox-ose: Can't select amount of RAM for virtual machine
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Virtualbox Team (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-29 12:30 UTC by Grzegorz Blach
Modified: 2013-07-03 14:06 UTC (History)
0 users

See Also:


Attachments
patch-src-VBox-Runtime-Makefile.kmk (472 bytes, text/plain; charset=ISO-8859-1)
2013-06-30 09:33 UTC, Martin Birgmeier
no flags Details
patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp (2.73 KB, text/plain; charset=ISO-8859-1)
2013-06-30 09:33 UTC, Martin Birgmeier
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Grzegorz Blach freebsd_committer freebsd_triage 2013-06-29 12:30:00 UTC
After last update to 4.2.14 I'm only able to assign 0 MB of RAM to new
virtual machine, which is definitely too low. Also next button is unactive.
You can look on 'Memory size' window at http://files.roorback.net/vbox.jpg
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-29 17:31:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->vbox

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Mark Linimon 2013-06-30 01:24:41 UTC
----- Forwarded message from Waitman Gobble <uzimac@da3m0n8t3r.com> -----

Date: Sat, 29 Jun 2013 11:53:47 -0700 (PDT)
From: Waitman Gobble <uzimac@da3m0n8t3r.com>
To: Grzegorz Blach <gblach@freebsd.org>
Cc: freebsd-ports-bugs@freebsd.org, vbox@freebsd.org
Subject: Re: ports/180086: VirtualBox - Can't select amount of RAM for virtual machine

On Sat, 29 Jun 2013 11:23:50 GMT, Grzegorz Blach <gblach@freebsd.org> wrote:
> After last update to 4.2.14 I'm only able to assign 0 MB of RAM to new
> virtual machine, which is definitely too low. Also next button is unactive.
> You can look on 'Memory size' window at http://files.roorback.net/vbox.jpg


I have noticed this problem on 10.0-Current, started about one month ago.
Hitting 'settings' in the gui for any existing machine causes it to 'hang'
indefinitely, and when creating a new machine there is no way to change the
RAM, and no way to move 'forward' in config wizard as Grzegorz Blach has
reported. There do not appear to be any error messages or warnings from
VirtualBox gui, it just sits there until the end of time.

However, using VBoxManage on command line works, allowing you to create and
edit machines. Launching machines from gui works too.

I attached gdb to the VirtualBox process, it looks like it's spinning around
in a pthread function when the problem happens. 
When I get some time I need to rebuild with debugging symbols to get a good
sense of what's going on. 


--
Waitman Gobble
San Jose California USA
+1.5108307875


_______________________________________________
freebsd-ports-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports-bugs
To unsubscribe, send any mail to "freebsd-ports-bugs-unsubscribe@freebsd.org"


----- End forwarded message -----
Comment 3 Martin Birgmeier 2013-06-30 09:33:21 UTC
Could you please try the attached patches?

Regards,

Martin
Comment 4 Grzegorz Blach 2013-06-30 12:30:07 UTC
With this two patches VirtualBox can detect amount of RAM in my computer
and is fully usable. Thanks you.


On Sun, 2013-06-30 at 10:33 +0200, Martin Birgmeier wrote:
> Could you please try the attached patches?
> 
> Regards,
> 
> Martin
>
Comment 5 dfilter service freebsd_committer freebsd_triage 2013-07-03 13:56:56 UTC
Author: decke
Date: Wed Jul  3 12:56:48 2013
New Revision: 322228
URL: http://svnweb.freebsd.org/changeset/ports/322228

Log:
  - Changing RAM for a VM was broken in the GUI because there was no
  implementation for FreeBSD that could calculate available RAM.
  
  PR:		ports/180086
  Submitted by:	Martin Birgmeier <Martin.Birgmeier@aon.at>

Added:
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk   (contents, props changed)
  head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp   (contents, props changed)
Modified:
  head/emulators/virtualbox-ose/Makefile

Modified: head/emulators/virtualbox-ose/Makefile
==============================================================================
--- head/emulators/virtualbox-ose/Makefile	Wed Jul  3 12:44:17 2013	(r322227)
+++ head/emulators/virtualbox-ose/Makefile	Wed Jul  3 12:56:48 2013	(r322228)
@@ -3,6 +3,7 @@
 
 PORTNAME=	virtualbox-ose
 DISTVERSION=	4.2.14
+PORTREVISION=	1
 CATEGORIES=	emulators
 MASTER_SITES=	http://download.virtualbox.org/virtualbox/${DISTVERSION}/ \
 		http://tmp.chruetertee.ch/ \

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-Makefile.kmk	Wed Jul  3 12:56:48 2013	(r322228)
@@ -0,0 +1,11 @@
+--- src/VBox/Runtime/Makefile.kmk.orig	2013-06-21 16:27:18.000000000 +0400
++++ src/VBox/Runtime/Makefile.kmk	2013-06-30 14:57:33.248215681 +0400
+@@ -844,7 +844,7 @@
+ 	r3/posix/RTMemProtect-posix.cpp \
+ 	r3/posix/RTPathUserHome-posix.cpp \
+ 	r3/posix/RTSystemQueryOSInfo-posix.cpp \
+-	r3/posix/RTSystemQueryTotalRam-posix.cpp \
++	r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp \
+ 	r3/posix/RTTimeNow-posix.cpp \
+ 	r3/posix/RTTimeSet-posix.cpp \
+ 	r3/posix/dir-posix.cpp \

Added: head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r3-freebsd-RTSystemQueryTotalRam-freebsd.cpp	Wed Jul  3 12:56:48 2013	(r322228)
@@ -0,0 +1,83 @@
+--- ./src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp.ORIG	2013-06-30 09:27:59.000000000 +0200
++++ ./src/VBox/Runtime/r3/freebsd/RTSystemQueryTotalRam-freebsd.cpp	2013-06-30 09:51:29.000000000 +0200
+@@ -0,0 +1,80 @@
++/* $Id: RTSystemQueryTotalRam-freebsd.cpp $ */
++/** @file
++ * IPRT - RTSystemQueryTotalRam, FreeBSD style
++ */
++
++/*
++ * Copyright (C) 2013 Martin Birgmeier, Oracle Corporation
++ *
++ * This file is part of VirtualBox Open Source Edition (OSE), as
++ * available from http://www.virtualbox.org. This file is free software;
++ * you can redistribute it and/or modify it under the terms of the GNU
++ * General Public License (GPL) as published by the Free Software
++ * Foundation, in version 2 as it comes in the "COPYING" file of the
++ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
++ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
++ *
++ * The contents of this file may alternatively be used under the terms
++ * of the Common Development and Distribution License Version 1.0
++ * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
++ * VirtualBox OSE distribution, in which case the provisions of the
++ * CDDL are applicable instead of those of the GPL.
++ *
++ * You may elect to license modified versions of this file under the
++ * terms and conditions of either the GPL or the CDDL or both.
++ */
++
++
++/*******************************************************************************
++*   Header Files                                                               *
++*******************************************************************************/
++#include <iprt/system.h>
++#include "internal/iprt.h"
++
++#include <iprt/err.h>
++#include <iprt/assert.h>
++#include <iprt/string.h>
++
++/* FreeBSD */
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#include <sys/errno.h>
++
++RTDECL(int) RTSystemQueryTotalRam(uint64_t *pcb)
++{
++    int mib[2];
++    size_t pcblen = sizeof(*pcb);
++
++    AssertPtrReturn(pcb, VERR_INVALID_POINTER);
++
++    mib[0] = CTL_HW;
++    mib[1] = HW_PHYSMEM;	/* HW_REALMEM is also possible, but
++				   includes non-main memory as well */
++    *pcb = 0;
++    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) {
++	if (pcblen == sizeof(*pcb))
++	    return VINF_SUCCESS;
++	else
++	    return VERR_NO_MEMORY;	/* XXX */
++    }
++    return RTErrConvertFromErrno(errno);
++}
++
++RTDECL(int) RTSystemQueryAvailableRam(uint64_t *pcb)
++{
++    int mib[2];
++    size_t pcblen = sizeof(*pcb);
++
++    AssertPtrReturn(pcb, VERR_INVALID_POINTER);
++
++    mib[0] = CTL_HW;
++    mib[1] = HW_USERMEM;
++    *pcb = 0;
++    if (sysctl(mib, 2, pcb, &pcblen, NULL, 0) == 0) {
++	if (pcblen == sizeof(*pcb))
++	    return VINF_SUCCESS;
++	else
++	    return VERR_NO_MEMORY;	/* XXX */
++    }
++    return RTErrConvertFromErrno(errno);
++}
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Bernhard Froehlich freebsd_committer freebsd_triage 2013-07-03 14:06:26 UTC
State Changed
From-To: open->closed

Committed. Thanks!