Determining If A Monitor Is Off: "AnswerDetermining If A Monitor Is Off
*
Wednesday, July 18, 2007 5:03 PMstack Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I've found code that will turn a monitor on and off:
Code Snippet
#include
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// Eliminate user's interaction for 500 ms
Sleep(500);
// Turn off monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
// Turn on monitor
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1);
// Low power monitor
// SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 1);
return 0;
}
Now I am looking for code that will tell me if a monitor is on or off. Anyone have any examples?
o ReplyReply
o QuoteQuote
Answers
*
Thursday, July 19, 2007 8:10 AMBruno van Dooren Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I don't know. Try asking in the appropriate platform SDK nntp newsgroup
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
Even if you can query the monitor state, this won't tell you if the monitor itself is powered on.
At home I still use a 19' iyama crt. Windows doesn't know when I press the monitor power button.
Btw: have you tried google or www.codeproject.com ?
o ReplyReply
o QuoteQuote
All Replies
*
Thursday, July 19, 2007 8:10 AMBruno van Dooren Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I don't know. Try asking in the appropriate platform SDK nntp newsgroup
http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx
Even if you can query the monitor state, this won't tell you if the monitor itself is powered on.
At home I still use a 19' iyama crt. Windows doesn't know when I press the monitor power button.
Btw: have you tried google or www.codeproject.com ?
o ReplyReply
o QuoteQuote
– Enviado usando a Barra de Ferramentas Google"
segunda-feira, 22 de novembro de 2010
How to detect if monitor was on or off with C#
How to detect if monitor was on or off with C#: "AnswerHow to detect if monitor was on or off with C#
*
Monday, June 01, 2009 8:48 AMRiteru Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I'm trying to write a software to detect the status of monitor (or perhap HD LCD television screen) in order to create a report about the availability of the output screen.
- I've tried to use WMI (Win32_DesktopMonitor ) to check availability but it alway return 3 which mean On, no matter my computer LCD screen is On or Off;
Anyone have any idea on detecting the monitor status?
PS. The LCD screen i'm using connected to my PC via DVI port, I'm not sure yet which port will be used in the real run (DVI, Serial , etc) so I'm trying to find a solution that can support all this port.
o ReplyReply
o QuoteQuote
Answers
*
Tuesday, June 02, 2009 12:32 PMJagadeesan Kandasamy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I hope this might be helpful...
Try to use with GetDesktopWindow(), The below code is just to switch on / off the moniter, from this you can try to the status as well.
[DllImport(
'user32.dll')]
static
extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern bool PostMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
static
extern bool PostThreadMessage(uint idThread, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendMessageCallback(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam,
SendMessageDelegate lpCallBack,
UIntPtr dwData);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendNotifyMessage(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
private
static extern IntPtr GetDesktopWindow();
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
const
int SC_MONITORPOWER = 0xF170;
const
int WM_SYSCOMMAND = 0x0112;
const
int MONITORON = -1;
const
int MONITOROFF = 2;
const
int MONITORSTANBY = 1;
int
HWND_BROADCAST = 0xffff; //the message is sent to all top-level windows in the system
int
HWND_TOPMOST = -1;
int
HWND_TOP = 0; //
int
HWND_BOTTOM = 1; //limited use
int
HWND_NOTOPMOST = -2; //
Form frm =
new Form();
Frm.Handle();
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOROFF );
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITORON);
Regards, Jagadeesan
o Marked As Answer byBin-ze ZhaoMicrosoft, ModeratorFriday, June 05, 2009 2:04 AM
o
o ReplyReply
o QuoteQuote
All Replies
*
Tuesday, June 02, 2009 12:32 PMJagadeesan Kandasamy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I hope this might be helpful...
Try to use with GetDesktopWindow(), The below code is just to switch on / off the moniter, from this you can try to the status as well.
[DllImport(
'user32.dll')]
static
extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern bool PostMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
static
extern bool PostThreadMessage(uint idThread, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendMessageCallback(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam,
SendMessageDelegate lpCallBack,
UIntPtr dwData);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendNotifyMessage(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
private
static extern IntPtr GetDesktopWindow();
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
const
int SC_MONITORPOWER = 0xF170;
const
int WM_SYSCOMMAND = 0x0112;
const
int MONITORON = -1;
const
int MONITOROFF = 2;
const
int MONITORSTANBY = 1;
int
HWND_BROADCAST = 0xffff; //the message is sent to all top-level windows in the system
int
HWND_TOPMOST = -1;
int
HWND_TOP = 0; //
int
HWND_BOTTOM = 1; //limited use
int
HWND_NOTOPMOST = -2; //
Form frm =
new Form();
Frm.Handle();
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOROFF );
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITORON);
Regards, Jagadeesan
o Marked As Answer byBin-ze ZhaoMicrosoft, ModeratorFriday, June 05, 2009 2:04 AM
o
– Enviado usando a Barra de Ferramentas Google"
*
Monday, June 01, 2009 8:48 AMRiteru Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I'm trying to write a software to detect the status of monitor (or perhap HD LCD television screen) in order to create a report about the availability of the output screen.
- I've tried to use WMI (Win32_DesktopMonitor ) to check availability but it alway return 3 which mean On, no matter my computer LCD screen is On or Off;
Anyone have any idea on detecting the monitor status?
PS. The LCD screen i'm using connected to my PC via DVI port, I'm not sure yet which port will be used in the real run (DVI, Serial , etc) so I'm trying to find a solution that can support all this port.
o ReplyReply
o QuoteQuote
Answers
*
Tuesday, June 02, 2009 12:32 PMJagadeesan Kandasamy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I hope this might be helpful...
Try to use with GetDesktopWindow(), The below code is just to switch on / off the moniter, from this you can try to the status as well.
[DllImport(
'user32.dll')]
static
extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern bool PostMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
static
extern bool PostThreadMessage(uint idThread, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendMessageCallback(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam,
SendMessageDelegate lpCallBack,
UIntPtr dwData);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendNotifyMessage(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
private
static extern IntPtr GetDesktopWindow();
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
const
int SC_MONITORPOWER = 0xF170;
const
int WM_SYSCOMMAND = 0x0112;
const
int MONITORON = -1;
const
int MONITOROFF = 2;
const
int MONITORSTANBY = 1;
int
HWND_BROADCAST = 0xffff; //the message is sent to all top-level windows in the system
int
HWND_TOPMOST = -1;
int
HWND_TOP = 0; //
int
HWND_BOTTOM = 1; //limited use
int
HWND_NOTOPMOST = -2; //
Form frm =
new Form();
Frm.Handle();
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOROFF );
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITORON);
Regards, Jagadeesan
o Marked As Answer byBin-ze ZhaoMicrosoft, ModeratorFriday, June 05, 2009 2:04 AM
o
o ReplyReply
o QuoteQuote
All Replies
*
Tuesday, June 02, 2009 12:32 PMJagadeesan Kandasamy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Answer
Sign In to Vote
0
Sign In to Vote
I hope this might be helpful...
Try to use with GetDesktopWindow(), The below code is just to switch on / off the moniter, from this you can try to the status as well.
[DllImport(
'user32.dll')]
static
extern IntPtr SendMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern bool PostMessage(IntPtr hWnd, uint Msg,
IntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
static
extern bool PostThreadMessage(uint idThread, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendMessageCallback(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam,
SendMessageDelegate lpCallBack,
UIntPtr dwData);
//Or
[DllImport(
'user32.dll', SetLastError=true, CharSet=CharSet.Auto)]
static
extern bool SendNotifyMessage(IntPtr hWnd, uint Msg,
UIntPtr wParam, IntPtr lParam);
//Or
[DllImport(
'user32.dll')]
private
static extern IntPtr GetDesktopWindow();
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindow(string lpClassName, string lpWindowName);
//Or
[DllImport(
'user32.dll', SetLastError = true)]
static
extern IntPtr FindWindowEx(IntPtr hwndParent,
IntPtr hwndChildAfter, string lpszClass, string lpszWindow);
const
int SC_MONITORPOWER = 0xF170;
const
int WM_SYSCOMMAND = 0x0112;
const
int MONITORON = -1;
const
int MONITOROFF = 2;
const
int MONITORSTANBY = 1;
int
HWND_BROADCAST = 0xffff; //the message is sent to all top-level windows in the system
int
HWND_TOPMOST = -1;
int
HWND_TOP = 0; //
int
HWND_BOTTOM = 1; //limited use
int
HWND_NOTOPMOST = -2; //
Form frm =
new Form();
Frm.Handle();
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOROFF );
SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITORON);
Regards, Jagadeesan
o Marked As Answer byBin-ze ZhaoMicrosoft, ModeratorFriday, June 05, 2009 2:04 AM
o
– Enviado usando a Barra de Ferramentas Google"
SC_MONITORPOWER in Windows 7?
SC_MONITORPOWER in Windows 7?: "SC_MONITORPOWER in Windows 7?
*
Wednesday, January 13, 2010 1:46 PMRodTech Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
Hi, I have developed a program which turns off the monitor by sending message :
SendMessage(-1, WM_SYSCOMMAND, SC_MONITORPOWER, 2)
The problem is that is not working in Windows 7. Does anybody know if WM_SYSCOMMAND and SC_MONITORPOWER are still supported in Win7?
In case is not, what are the replacemente for this actions? thanks in advance
Rod
o ReplyReply
o QuoteQuote
All Replies
*
Sunday, February 28, 2010 6:31 PMRaymond Rogers Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I'm seeing the same problem with my application. Have you found a solution for this yet?
o ReplyReply
o QuoteQuote
*
Friday, June 11, 2010 5:30 PMRomashka_Sky Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
o ReplyReply
o QuoteQuote
– Enviado usando a Barra de Ferramentas Google"
*
Wednesday, January 13, 2010 1:46 PMRodTech Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
Hi, I have developed a program which turns off the monitor by sending message :
SendMessage(-1, WM_SYSCOMMAND, SC_MONITORPOWER, 2)
The problem is that is not working in Windows 7. Does anybody know if WM_SYSCOMMAND and SC_MONITORPOWER are still supported in Win7?
In case is not, what are the replacemente for this actions? thanks in advance
Rod
o ReplyReply
o QuoteQuote
All Replies
*
Sunday, February 28, 2010 6:31 PMRaymond Rogers Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
I'm seeing the same problem with my application. Have you found a solution for this yet?
o ReplyReply
o QuoteQuote
*
Friday, June 11, 2010 5:30 PMRomashka_Sky Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
Sign In to Vote
0
Sign In to Vote
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2);
o ReplyReply
o QuoteQuote
– Enviado usando a Barra de Ferramentas Google"
Visual Basic :: Turn Monitor Off Or Place It On Standby...
Visual Basic :: Turn Monitor Off Or Place It On Standby...: "Turn Monitor Off Or Place It On Standby...
I have found this code splattered all over VBF, or code similar, which I have modified...
VB Code:
Option Explicit Private Declare Function SendMessage Lib 'user32' Alias 'SendMessageA' (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long Private Const WM_SYSCOMMAND = &H112Private Const SC_MONITORPOWER = &HF170 Private Sub cmdTurnOFF_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2&)End Sub Private Sub cmdStandby_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1&)End Sub Private Sub cmdTurnON_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1&)End Sub
But it doesn't work...I alwasy get a 0 returned from the SendMessage and the monitor does absolutely nowt
Anyone got any ideas?
Woka
– Enviado usando a Barra de Ferramentas Google"
I have found this code splattered all over VBF, or code similar, which I have modified...
VB Code:
Option Explicit Private Declare Function SendMessage Lib 'user32' Alias 'SendMessageA' (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long Private Const WM_SYSCOMMAND = &H112Private Const SC_MONITORPOWER = &HF170 Private Sub cmdTurnOFF_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 2&)End Sub Private Sub cmdStandby_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, 1&)End Sub Private Sub cmdTurnON_Click() Debug.Print SendMessage(Form1.hwnd, WM_SYSCOMMAND, SC_MONITORPOWER, -1&)End Sub
But it doesn't work...I alwasy get a 0 returned from the SendMessage and the monitor does absolutely nowt
Anyone got any ideas?
Woka
– Enviado usando a Barra de Ferramentas Google"
quinta-feira, 4 de novembro de 2010
16 bit in Windows 7 with XP mode
16 bit in Windows 7 with XP mode
Assuming you can run the program on Windows XP, you might be able to run it. If you meet the hardware requirements you can go ahead and try it out. See the following link for the requirements and other information about Windows XP mode:
http://www.microsoft.com/windows/virtual-pc/get-started.aspx
Assuming you can run the program on Windows XP, you might be able to run it. If you meet the hardware requirements you can go ahead and try it out. See the following link for the requirements and other information about Windows XP mode:
http://www.microsoft.com/windows/virtual-pc/get-started.aspx
sexta-feira, 29 de outubro de 2010
Ubuntu Bloke: HOWTO: VirtualBox 3.2 "headless" on Lucid Lynx
Ubuntu Bloke: HOWTO: VirtualBox 3.2 "headless" on Lucid Lynx: "HOWTO: VirtualBox 3.2 'headless' on
As of karmic koala, Vbox 3.x is provided via the standard Ubuntu repositories. Unfortunately, this is the OSE version and it does not appear to work headless.
So, we have to download the "free as in beer" version from the Oracle website, which is currently here
At the time of writing the current build for Lucid is virtualbox-3.2_3.2.4-62467~Ubuntu~lucid_i386.deb
Before we can install the deb, we will also need to install some dependencies.
Now we can install the virtualbox deb that we downloaded earlier.
Next, add your user account to the vboxusers group
Virtualbox machines that you create will by default go in your home directory
Ensure vboxusers have appropriate permissions to the kernel, create the file;
/etc/udev/rules.d/40-permissions.rules
That's it, Virtualbox should be installed and ready to go.
Now we can move on to creating a virtual machine
Create a machine named "io"
Configure it with a nic bridged to eth0, 256Mb RAM, enable acpi and set to boot from DVD
Create a virtual IDE controller
Create a virtual HDD
Attach the virtual HDD
Create and attach a virtual DVD drive to the controller and insert the DVD image
The default vrdp port for machines is 3389, however, if you intend to run more than one guest then each one will need to listen on a different port. I use the 3xxx range with the xxx being the last octet of the machines IP address. For example, 192.168.0.1 would be 3001.
And thats it, your machine has been created. Time to start it up and give it a test drive!
Using the virtual machine
Start the machine
On a GUI workstation, establish a remote desktop connection to the machine. In my case, the host server is called "jupiter" so I type;
After you have installed the OS, you need to tell the machine to boot from the hdd.
You can also deregister the dvd image if you don't intend to use it again.
Here are some other useful commands;
HOWTO: VirtualBox 3.2 "headless" on Lucid Lynx
So, we have to download the "free as in beer" version from the Oracle website, which is currently here
At the time of writing the current build for Lucid is virtualbox-3.2_3.2.4-62467~Ubuntu~lucid_i386.deb
Before we can install the deb, we will also need to install some dependencies.
sudo apt-get install libcurl3 dkms libqt4-network libqtgui4 libxslt1.1 libasound2 \
libdirectfb-1.2-0 libgl1-mesa-dri libgl1-mesa-glx libqt4-opengl libsdl1.2debian \
libsdl1.2debian-alsa libsysfs2 libts-0.0-0 libxcursor1 linux-headers-`uname -r` \
libxdamage1 libxfixes3 libxmu6 libxxf86vm1 tsconf
Now we can install the virtualbox deb that we downloaded earlier.
sudo dpkg -i virtualbox-3.2_3.2.4-62467~Ubuntu~lucid_i386.deb
Next, add your user account to the vboxusers group
sudo adduser brettg vboxusers
Virtualbox machines that you create will by default go in your home directory
/home/brettg/.VirtualBox/
Ensure vboxusers have appropriate permissions to the kernel, create the file;
sudo vi /etc/udev/rules.d/40-permissions.rules
/etc/udev/rules.d/40-permissions.rules
KERNEL=="vboxdrv", GROUP="vboxusers", MODE="0660"
That's it, Virtualbox should be installed and ready to go.
Now we can move on to creating a virtual machine
Create a machine named "io"
VBoxManage createvm -name io --ostype Ubuntu -register
Configure it with a nic bridged to eth0, 256Mb RAM, enable acpi and set to boot from DVD
VBoxManage modifyvm io --memory 256 --pae on --acpi on --boot1 dvd --nic1 bridged --bridgeadapter1 eth0
Create a virtual IDE controller
VBoxManage storagectl io --name IDE0 --add ide
Create a virtual HDD
VBoxManage createvdi -filename ~/.VirtualBox/Machines/io/sda.vdi -size 48000 -register
Attach the virtual HDD
VBoxManage storageattach io --storagectl IDE0 --port 0 --device 0 --type hdd --medium ~/.VirtualBox/Machines/io/sda.vdi
Create and attach a virtual DVD drive to the controller and insert the DVD image
VBoxManage storageattach io --storagectl IDE0 --port 1 --device 0 --type dvddrive --medium /store/archive/ISO/ubuntu-10.04-server-i386.iso
The default vrdp port for machines is 3389, however, if you intend to run more than one guest then each one will need to listen on a different port. I use the 3xxx range with the xxx being the last octet of the machines IP address. For example, 192.168.0.1 would be 3001.
VBoxManage modifyvm io --vrdpport 3001
And thats it, your machine has been created. Time to start it up and give it a test drive!
Using the virtual machine
Start the machine
nohup VBoxHeadless -startvm io &
On a GUI workstation, establish a remote desktop connection to the machine. In my case, the host server is called "jupiter" so I type;
rdesktop -a 8 jupiter:3001
After you have installed the OS, you need to tell the machine to boot from the hdd.
VBoxManage modifyvm io --boot1 disk
You can also deregister the dvd image if you don't intend to use it again.
VBoxManage unregisterimage dvd /store/archive/ISO/ubuntu-10.04-server-i386.iso
Here are some other useful commands;
VBoxManage showvminfo io
VBoxManage list hdds
VBoxManage list runningvms
VBoxManage controlvm io poweroff
VBoxManage unregistervm io --delete
VBoxManage controlvm io savestate
VBoxManage closemedium disk UUID
VBoxManage modifyhd UUID --type immutable
[ubuntu] Virtualbox: Save Windows XP guest screen resolution - Ubuntu Forums
[ubuntu] Virtualbox: Save Windows XP guest screen resolution - Ubuntu Forums: "Virtualbox: Save
Virtualbox: Save Windows XP guest screen resolution
I've got VirtualBox 1.6.2 installed on a Ubuntu 8.04 host. Running Windows XP SP3 in VM. I prefer to use a screen resolution of 1440x900x32 for my guest and can easily set this using:
VBoxManage controlvm [xpGuestName] setvideomodehint 1440 900 32
HOWEVER, I have to do this every time, as the default resolution of 1024x768 is how it starts at bootup. Is there any way to save the 1440x900 screen resolution properties so that my VBox WinXP guest will start that way every time?
VBoxManage controlvm [xpGuestName] setvideomodehint 1440 900 32
HOWEVER, I have to do this every time, as the default resolution of 1024x768 is how it starts at bootup. Is there any way to save the 1440x900 screen resolution properties so that my VBox WinXP guest will start that way every time?
Assinar:
Postagens (Atom)