GithubHelp home page GithubHelp logo

Comments (10)

marcelojannotti avatar marcelojannotti commented on July 18, 2024 2

You need enable "Advanced Config"
var $enableAdvancedConfig = true;
Can you set as global or in each vm config.
For you fix it in new vms machines, you can implement fixes that I mencioned on old posts.
After implment the fix you would can disable the advanced config again.

from phpvirtualbox.

tom077 avatar tom077 commented on July 18, 2024 1

This is an old issue, but it is still relevant and instructions could be added in the Wiki.

Using the RDP client requires that your web browser has an up-to-date Flash plugin installed and enabled. Your server (the host running VirtualBox vboxwebsrv) must have the VirtualBox extension pack installed.

The phpvirtualbox RDP client will try to connect to the IP address defined in config.php : var $consoleHost = '_IP address_';. The "consoleHost" IP address can also be (temporary) changed directly in the console pane, next to the "Connect" button.
If the "consoleHost" IP address is unset (by default), the phpvirtualbox RDP client will try to connect to '127.0.0.1 (localhost IP address).

If you access phpvirtualbox with a web browser directly from your server, RDP console should work fine with the default config.php (E.G. default consoleHost IP address = '127.0.0.1').

On the other hand, if you access phpvirtualbox with a web browser from another machine, RDP console can't work with the default config.php because, in that context, '127.0.0.1' is the localhost IP address of your local machine which is not the one listening for RDP connections. You will get an error message "TCP: SECURITY_ERROR Error #2048". You need to define a proper "consoleHost" IP address in config.php :

  • If your server and your local machine are running on the same private network (typically 192.168.X.X), you can set var $consoleHost = '_your server's private IP address_';. Your server needs to accept connections on virtualbox RDP ports (typically ports 92XX) through its firewall.

  • Otherwise, if your server is running on a public network, you may not want to allow anyone to connect to your VMs through RDP by opening you server firewall, so you'd better use a VPN and set var $consoleHost = '_your server's VPN IP address_';. If your local machine is connected to the same VPN, the phpvirtualbox RDP client should work fine.

from phpvirtualbox.

nimnulok avatar nimnulok commented on July 18, 2024 1

Hi. In my system (Ubuntu_18.04+virtualbox_5.2.16+phpvirturtualbox_5.2+php_7.2 I didn't see this field "net address".
1532593577743
But I fix It. I reinstall virtualbox. Create new virtual machine and it works.
vbox@backup:/home/sysadmin$ netstat -l -n
Активные соединения с интернетом (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 172.20.0.230:18083 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:9000 0.0.0.0: LISTEN*
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:445 0.0.0.0:* LISTEN
tcp6 0 0 :::139 :::* LISTEN
tcp6 0 0 :::80 :::* LISTEN
tcp6 0 0 :::22 :::* LISTEN
tcp6 0 0 :::445 :::* LISTEN

I found differense in .vbox of my
first virtual machive (not working) localhost interface:

      (<VRDEProperties>
      <Property name="TCP/Address" value="127.0.0.1"/>
      <Property name="TCP/Ports" value="9100"/>)

 second new was created again after reinstalling and editing config.php  ($vrdeaddress = 0.0.0.0)

VRDEProperties>
Property name="TCP/Address" value="0.0.0.0"/>
Property name="TCP/Ports" value="9000-9100"/>
/VRDEProperties>)"

Thank you.

from phpvirtualbox.

marcelojannotti avatar marcelojannotti commented on July 18, 2024

Generally this occur when phpvirtualbox is not the same that virtualbox server. after Rodrigo Osorio's change, the vrdeaddress is set by default as 127.0.0.1 and not empty how is default of virtualbox.

solution is set on config.php:

$vrdeaddress = '0.0.0.0';

Actually is not permited empty value, but I fix it on #124

from phpvirtualbox.

nimnulok avatar nimnulok commented on July 18, 2024

Hello. I installed phpvirtualbox 5.2. I did all this step, but from my Fifefox with Flash Player 30 version I didn't connect to the console. I was this message "Disconnect reason: E: TCP: SECURITY_ERROR Error #2048" message. My server bind to the local interface (127.0.0.1), not private (172.20.0.230) network interface.

root@backup:/home/sysadmin# netstat -l
Active connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 backup.loc:18083 0.0.0.0:* LISTEN
tcp 0 0 localhost:9001 0.0.0.0: LISTEN*
tcp 0 0 0.0.0.0:netbios-ssn 0.0.0.0:* LISTEN
tcp 0 0 localhost:domain 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:microsoft-ds 0.0.0.0:* LISTEN
tcp6 0 0 [::]:netbios-ssn [::]:* LISTEN
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
tcp6 0 0 [::]:microsoft-ds [::]:* LISTEN
udp 45312 0 localhost:domain 0.0.0.0:*
udp 13056 0 172.20.0.255:netbios-ns 0.0.0.0:*
udp 0 0 backup.loc:netbios-ns 0.0.0.0:*
udp 13056 0 0.0.0.0:netbios-ns 0.0.0.0:*
udp 33024 0 172.20.0.25:netbios-dgm 0.0.0.0:*
udp 0 0 backup.loc:netbios-dgm 0.0.0.0:*
udp 33024 0 0.0.0.0:netbios-dgm 0.0.0.0:*

I can't find any decision.
1532442927386

1532443018232

from phpvirtualbox.

tom077 avatar tom077 commented on July 18, 2024

Hi,

What is 172.20.0.230? client side or server side? or both (vboxwebsrv/phpvirtualbox hosted by your laptop/desktop)?

Your netstat output tcp 0 0 localhost:9001 0.0.0.0: LISTEN* says that whatever your config is, it's listening for RDP connection on port 9001 and on local loopback interface (127.0.0.1).
Is the console working using 127.0.0.1:9001, instead of 172.20.0.230:9001?

By the way, does anybody know the difference between var $vrdeaddress and var $consoleHost in config.php?

I am not able to use the console in phpvirtualbox's GUI without setting a VPN (openVPN) between my client laptop and my server (hosted far away, across the web). I use 10.8.0.1:9XXX to connect to the console (10.8.0.1 is my server's VPN address).

from phpvirtualbox.

nimnulok avatar nimnulok commented on July 18, 2024

hi. 172.20.0.230 is Server with virtualbox. net 172.20.0.0/24
I try to connect from my network 172.20.0.0/24.
config.php
class phpVBoxConfig {

/* Username / Password for system user that runs VirtualBox */
var $username = 'vbox';
var $password = 'password';

/* SOAP URL of vboxwebsrv (not phpVirtualBox's URL) */
var $location = 'http://127.0.0.1:18083/';

/* Default language. See languages folder for more language options.

  • Can also be changed in File -> Preferences -> Language in
  • phpVirtualBox.
    */
    var $language = 'en';

/* Set the standard VRDE Port Number / Range, e.g. 1010-1020 or 1027 /
var $vrdeports = '9000-9100';
/
Set the default VRDE address, e.g. 192.168.1.1 */
//var $vrdeaddress = '0.0.0.0';

/*
*

  • Not-so-common options / tweaking

*/

// Multiple servers example config. Uncomment (remove /* and /) to use.
// Add ALL the servers you want to use. Even if you have the server set
// above. The default server will be the first one in the list.
/

var $servers = array(
array(
'name' => 'London',
'username' => 'user',
'password' => 'pass',
'location' => 'http://192.168.1.1:18083/',
'authMaster' => true // Use this server for authentication
),
array(
'name' => 'New York',
'username' => 'user2',
'password' => 'pass2',
'location' => 'http://192.168.1.2:18083/'
),
);
*/

// Disable authentication
#var $noAuth = true;

// Host / ip to use for console connections
var $consoleHost = '172.20.0.230';

// Disable "preview" box
#var $noPreview = true;

// Default preview box update interval in seconds
#var $previewUpdateInterval = 30;

// Preview box pixel width
#var $previewWidth = 180;

// Max number of progress operations to keep in list
var $maxProgressList = 5;

// Change default preview aspect ratio to 1.
// http://www.wikipedia.org/wiki/Aspect_ratio_%28image%29#Previous_and_presently_used_aspect_ratios
#var $previewAspectRatio = 1.6;

// Enable custom VM icons
#var $enableCustomIcons = true;

/*
Exclusively use phpVirtualBox's groups configuration rather than VirtualBox groups.
This has the following effects:

*) Group changes made in phpVirtualBox will not be reflected in VirtualBox programs such as
VirtualBox and VBoxManage
*) Group changes will not affect which folder a VM is placed in
*) You can rename groups that contain running VMs and move / copy running VMs to groups
*/
#var $phpVboxGroups = true;

/*
Allow to prompt deletion hard disk files on removal from Virtual Media Manager.
If this is not set, files are always kept. If this is set, you will be PROMPTED
to decide whether or not you would like to delete the hard disk file(s) when you
remove a hard disk from virtual media manager. You may still choose not to delete
the file when prompted.
*/
var $deleteOnRemove = true;

/*

  • File / Folder browser settings
    */

// Restrict file types
var $browserRestrictFiles = array('.iso','.vdi','.vmdk','.img','.bin','.vhd','.hdd','.ovf','.ova','.xml','.vbox','.cdr','.dmg','.ima','.dsk','.vfd');

// Restrict locations / folders
#var $browserRestrictFolders = array('D:\','C:\Users\Ian'); // Or something like array('/home/vbox','/var/ISOs')

// Force use of local, web server based file browser instead of going through vboxwebsrv
#var $browserLocal = true;

// Disable file / folder browser.
#var $browserDisable = true;

// Disable Windows drive detection
#var $noWindowsDriveList = true;

// Just list all drives from C:\ - Z:\ without checking if they exist or not.
// This may be required on older Windows systems with more than one drive.
#var $forceWindowsAllDriveList = true;

/*

  • Misc
    */

/*

  • Auto-refresh interval in seconds for VirtualBox host memory usage information.
  • Any value below 3 will be ignored.
    */
    var $hostMemInfoRefreshInterval = 5;

/* Show % of free host memory instead of % used */
#var $hostMemInfoShowFreePct = true;

/*

  • VM Memory warnings.
  • If $vmMemoryStartLimitWarn is enabled, each time a VM is started through
  • phpVirtualBox, it will check that the available host memory is greater than
  • the base and video memory of the VM + 50MB (a little bit of overhead). If it
  • is not, a confirmation dialog will be presented to confirm that you want to
  • start the VM.
  • If $vmMemoryOffset is set (and $vmMemoryStartLimitWarn), $vmMemoryOffset
  • megabytes is subtracted from the available host memory before the check is
  • performed by $vmMemoryStartLimitWarn logic. For instance it may be a good
  • idea to always have VM memory requirements + 100MB free. 100 is the default.
    */
    #var $vmMemoryStartLimitWarn = true;
    #var $vmMemoryOffset = 100;

/*

  • Display guest additions version of a running VM on its Details tab
    */
    #var $enableGuestAdditionsVersionDisplay = true;

/* Disable any of phpVirtualBox's main tabs */
#var $disableTabVMSnapshots = true; // Snapshots tab
#var $disableTabVMConsole = true; // Console tab

/* Screen resolutions for console tab */
var $consoleResolutions = array('640x480','800x600','1024x768','1280x720','1440x900');

/* Console tab keyboard layout. Currently Oracle's RDP client only supports EN and DE. */
var $consoleKeyboardLayout = 'EN';

/* Max number of network cards per VM. Do not set above VirtualBox's limit (typically 8) or below 1 */
var $nicMax = 4;

/* Enable advanced configuration items (normally hidden in the VirtualBox GUI)

  • Note that some of these items may not be translated to languages other than English.
    */
    #var $enableAdvancedConfig = true;

/* Enable startup / shutdown configuration.

  • This only works in linux and you must add the vboxinit file to
  • your startup scripts list.
    */
    #var $startStopConfig = true;

// Authentication library.
var $authLib = 'Builtin';

// VM ownership
#var $enforceVMOwnership = true;

// Per-user VM quota
#var $vmQuotaPerUser = 2;

// Allow VDE network configuration. This must be supported by the underlying VirtualBox installation!
// If you do not know what VDE networking is - you do not need it, it is probably not supported by your
// VirtualBox installation and will cause errors if enabled.
#var $enableVDE = true;

// Disable setting SATA controllers port count to the max port number found when saving VMs.
#var $disableSataPortCount = true;

/* Enable Parallel Port configuration - EXPERIMENTAL
LPT support may or may not work for you.
!!! VirtualBox LPT support only works in Linux. !!!
*/
#var $enableLPTConfig = true;

/* Enable HardDisk IgnoreFlush configuration. This controls the "ExtraData" setting

/*

  • Event listener timeout in seconds. This is an advanced option that most people will
  • probably not need to change.
    */
    #var $eventListenerTimeout = 20;

/* END SETTINGS */

}

/etc/default/virtualbox

Defaults for virtualbox initscript

sourced by /etc/init.d/virtualbox

installed at /etc/default/virtualbox by the maintainer scripts

This is a POSIX shell fragment

Set this to 1 if you would like the virtualbox modules to be loaded by

the init script.

#LOAD_VBOXDRV_MODULE=1

SHUTDOWN_USERS="foo bar"

check for running VMs of user 'foo' and user 'bar'

'all' checks for all active users

SHUTDOWN=poweroff

SHUTDOWN=acpibutton

SHUTDOWN=savestate

select one of these shutdown methods for running VMs

acpibutton and savestate causes the init script to wait

30 seconds for the VMs to shutdown

#SHUTDOWN_USERS=""
#SHUTDOWN=poweroff

VBOXWEB_USER=vbox
VBOXWEB_HOST=127.0.0.1
#VBOXWEB_PORT=18083
#VBOXAOTPSTART_DB=/srv/vbox
#VBOXAOTPSTART_CONFIG=/srv/vbox/autostart.cfg
#VBOX_LOGFILE=/var/log/vboxweb-service

root@backup:/home/sysadmin# ps aux | grep vbox
vbox 1537 0.0 0.3 179700 13916 ? S июл24 0:00 /usr/lib/virtualbox/VBoxXPCOMIPCD
vbox 1545 0.0 0.5 813008 23836 ? Sl июл24 0:07 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
vbox 8693 0.7 0.7 1087988 29640 ? Sl 10:24 0:03 /usr/lib/virtualbox/vboxwebsrv --background -H 127.0.0.1
vbox 8764 5.7 21.4 3432428 854732 ? Sl 10:24 0:25 /usr/lib/virtualbox/VBoxHeadless --comment win7 --startvm fd3d5fb2-79e2-4d7b-8e8a-be93fe19307d --vrde conf

/sbin/ifconfig

root@backup:/home/sysadmin# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.20.0.230 netmask 255.255.255.0 broadcast 172.20.0.255
inet6 fe80::9618:82ff:fe37:8234 prefixlen 64 scopeid 0x20
ether 94:18:82:37:82:34 txqueuelen 1000 (Ethernet)
RX packets 977369 bytes 188816852 (188.8 MB)
RX errors 0 dropped 29927 overruns 0 frame 0
TX packets 110557 bytes 20446637 (20.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 1000 (Локальная петля (Loopback))
RX packets 79448 bytes 14137776 (14.1 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 79448 bytes 14137776 (14.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

/

from phpvirtualbox.

tom077 avatar tom077 commented on July 18, 2024

Hi,

According to your 'netstat' output, your server is currently listening RDP connection on port 9001, but on the localhost interface :
tcp 0 0 localhost:9001 0.0.0.0: LISTEN*

The localhost interface (127.0.0.1) of your server can't be reached from another machine in your network.

To meet you needs, the 'netstat' command should give the output:
tcp 0 0 0.0.0.0:9001 0.0.0.0:* LISTEN

Shutdown your 'win7' virtual machine.
Open the 'settings' windows for that virtual machine.
Go to 'Display'/'Remote DIsplay'.
What do you see in the 'Net Address' field?

If it contains '127.0.01', you should remove it and leave the field blank.

capture

Start your 'win7' virtual machine.
Try the console again.

You also need to check that port 9001 is open in your firewall (server side).

from phpvirtualbox.

mikedoth avatar mikedoth commented on July 18, 2024

I know this is old but if you remove the 127.0.0.1 from Net Address under the Display/Remote tab it will allow the RDP to work. However you must change the IP to the proper one when you download the auto generated file or that too won't work.

from phpvirtualbox.

trasherdk avatar trasherdk commented on July 18, 2024

In config.php at the end of the file, add:

    if ($this->vrdeaddress == '' || $this->vrdeaddress == '127.0.0.1' ) {
      $this->vrdeaddress = $_SERVER['SERVER_ADDR'];
    }

This, of course, only works if phpvirtualbox is served from the virtualbox host.

This is what the end of my config.php looks like:

/* END SETTINGS  */

  public function phpVBoxConfig() {
    if($this->authLib == 'VBoxAuthSimple') {
      session_start();
      $this->username = $this->getUsername();
      $this->password = $this->getPassword();
    }
    if ($this->vrdeaddress == '' || $this->vrdeaddress == '127.0.0.1' ) {
      $this->vrdeaddress = $_SERVER['SERVER_ADDR'];
    }
  }

  public function getUsername() {
    return $_SESSION['user'];
  }

  public function getPassword() {
    return $_SESSION['password'];
  }
} /** class phpVBoxConfig **/

from phpvirtualbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.