Skip to main content

Posts

Autostart VirtualBox VM on Ubuntu Server 18.04 Boot

Create a configuration file in /etc/default/ sudo nano /etc/default/virtualbox then add VBOXAUTOSTART_DB=/etc/vbox VBOXAUTOSTART_CONFIG=/etc/vbox/autostart.cfg Then create a configuration file in  /etc/vbox/ sudo nano /etc/vbox/autostart.cfg then add default_policy = deny # Create an entry for each user allowed to use autostart myusername = { allow = true } sudo chgrp vboxusers /etc/vbox sudo chmod 1775 /etc/vbox sudo usermod -aG vboxusers USERNAME VBoxManage setproperty autostartdbpath /etc/vbox Use the following command to get a list of available vms vboxmanage list vms Create a file with <username>.start on /etc/vbox sudo touch /etc/vbox/username.start sudo chown username /etc/vbox/username.start Restart the virtualbox service for changes to take effect sudo systemctl restart vboxautostart-service Specify the virtual machine that will be set to autostart VBoxManage modifyvm <uuid|vmname> --autostart-enabled <
Recent posts

Installing PhpMyAdmin on Ubuntu Server 16.04 with Nginx Webserver

Phpmyadmin installation with the following command sudo apt-get install phpmyadmin after installation, create a symbolic link to phpmyadmin contents sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin update configuration file /etc/nginx/sites-available/default location ~ \. php $ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.0-fpm.sock; } location /phpmyadmin { index index.php index.html index.htm; root /usr/share; } restart nginx service sudo systemctl reload nginx now we can access phpmyadmin via http://example.com/phpmyadmin For the latest version installation, download the file using wget wget https://files.phpmyadmin.net/phpMyAdmin/4.7.9/phpMyAdmin-4.7.9-all-languages.tar.gz You will need to unpack it with by using tar command tar xvf phpMyAdmin-4.7.9-all-languages.tar.gz move the extract file to /usr/share/phpmyadmin , and now

Setting Xdebug in XAMPP

Assume the xampp folder is stored in drive D, configuration of the php.ini file located at D:/xampp/php/  zend_extension="D:/xampp/php/ext/php_xdebug.dll" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 Do restart apache to enable this feature.

Yii : Image resize before ajax upload

File input control in form: <div class="row"> <img id="preview" width="200px" class="hidden"/> <?php echo CHtml :: label ( "File Foto" , 'file_image' ); ?> <?php echo CHtml :: fileField ( "file_image" , '' , array ( 'accept' => '.jpg' )); ?> <br/> <?php echo CHtml :: button ( "Upload Foto" , array ( 'id' => 'btn-upload' )); ?> </div> Button onclick event: Yii::app()->clientScript->registerScript('upload', " $('#btn-upload').click(function(){ resizeImage(); }); "); Javascript function : < script > function upload(dataurl) { var formData = new FormData($( "#tbl-hdrclaimrusak-form"

Yii : Image preview before upload

File input control in form: <div class="row"> <img id="preview" width="200px" class="hidden"/> <?php echo CHtml :: label ( "File Foto" , 'file_image' ); ?> <?php echo CHtml :: fileField ( "file_image" , '' , array ( 'accept' => '.jpg' )); ?> <br/> <?php echo CHtml :: button ( "Upload Foto" , array ( 'id' => 'btn-upload' )); ?> </div> Javascript onchange event: Yii::app()->clientScript->registerScript('preview', " $('#file_image').change(function(){ var file_name=$('#file_image').val(); var extension=file_name.split('.').pop(); if(extension=='jpg'||extension=='JPG'||extension=='jpeg'||extension

Auto start VirtualBox guest on system reboot (Ubuntu 16.04)

Here's how to turn on guest OS in VirtualBox automatically when host PC is turned on. In this guide I use Ubuntu 16.04 LTS 64bit and VirtualBox 5.1.22 All we need to do is create a file with the extension * .service and put in the /lib/systemd/system folder. In this guide use the autostartvbox.service file name as an example. sudo nano /lib/systemd/system/autostartvbox.service   The contents of the file are as follows #!/bin/sh [ Unit ] Description = Autostart VBOX Guest on Boot [ Service ] User = your_user ExecStart = /usr/bin/VBoxHeadless --startvm VirtualBox_Guest_Name [ Install ] WantedBy = multi-user.target     allows the service to run when the system boot with the following command sudo systemctl enable autostartvbox.service     If successful then the feedback obtained is as follows Created symlink from /etc/systemd/system/multi-user.target.wants/autostartvbox.service to /lib/systemd/system/autostartvbox.service     Restart the PC t

Ubuntu Server 16.04: Minimum GUI

As we know that Ubuntu Server by default does not have a GUI. But sometimes in certain cases, we need a GUI on Ubuntu Server. For example Ubuntu Server as the host of the virtual client (KVM, VirtualBox, VMware or other virtual applications). Although VirtualBox has a headless server configuration, having a GUI still makes it much easier in terms of virtual client maintenance. If we do a search on google, many articles or tutorials that discuss how to install GUI on Ubuntu Server. Where in general the command used the command for the installation as follows sudo apt-get install --no-install-recommends ubuntu-desktop If the command is executed, after restarting the server, it will display a GUI like the desktop version of Ubuntu. The --no-install-recommends argument should be used to avoid unnecessary package installations, such as multimedia applications, browsers, office applications and other desktop applications commonly found on desktop ubuntu installations. In general, m