Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Mounting a Windows hosted samba share from Linux (Fedora/Ubuntu/etc) – with a domain account

Samba shares can be finicky beasts. Mounting a samba (smb) point shared from a Windows host doubly tricky at times due to cross-platform differences such as domains.

If you ever find yourself trying to mount a Windows hosted Samba share and need to log in with a domain account, here’s the format:

sudo mount -t cifs -o domain=<YOURDOMAIN>,username=<YOURUSERNAME>,password=<YOURPASSWORD> //<HOSTNAME>/TestShare /mnt/

This mounts <hostname> which can be either an ip address or host name to the directory /mnt/ when using the proper domain, username and password. Whew.

You can also test your connection by using smbclient, which seems to have a more forgiving syntax.:

smbclient //<HOSTNAME>/TestShare -U <YOURDOMAIN>/<YOURUSERNAME>
ex:
smbclient //myhost.com/TestShare -U ibmdom/billwaters

This would connect you to myhost.com/Testshare directory using the user account billwaters that is part of the ibmdom domain. It would then prompt you for your password. You can also optionally add the password to the command line, but this allows you to type it in separately.

Making electronics is easy

Making electronics is easy

Tokyo-based startup AgIC made a pent that can transmit electricity with its silver ink. In an ad by Japanese infrastructure company Kandenko, a tiny 3D paper town comes to life as the pen conducts electricity as a person draws lines. The pen can be bought on Amazon for 1,296 yen (about 12$.)

Retractable/Invisible fences

Retractable/Invisible fences

A company called Fancy Fence in Poland makes wild fences/gates that retract into the ground. Clever, clean design. It even has an emergency mode in case power is lost.

They have different styles and both retractable driveway or sidewalk gates.

slide_2a

Using a physical drive/raw drive access with Virtualbox

Using a physical drive/raw drive access with Virtualbox

This comes from the good article here, or in the VirtualBox documentation.

Virtualization has been a tremendous help to developers such as myself. It keeps us from having to keep a pile of hard drives/machines all running different operating systems. And while this is great, there are some times when you might want to use a raw hard drive. For example, if you pull a hard drive out of an existing system and want to keep the OS/data intact but use it as a virtual machine inside another host OS.

Well, you can set up VirtualBox to use a physical hard drive inside a VM. This method is called “raw hard disk access.” This allows you to mount or boot a secondary hard drive or external USB as your storage device inside the VM.

Warning: Do not attempt to mount or boot the partition that runs the host OS with a VM, as that can lead to severe data corruption. And no matter which drive or partition you want to mount, it’s always a good idea to back up any existing data on it before continuing.

Creating the Virtual Machine:

You’ll first want to create a virtual machine within the VirtualBox GUI. Choose all options like normal, but when asked about the virtual hard drive, select Do not add a virtual hard drive.

Next, you’ll need to find the path and drive number of the physical drive you’d like to mount:

In Windows, open Disk Management. You’ll see the associated drive numbers on the left and will identify them later as PhysicalDrive0, PhysicalDrive1, etc.

In Linux, run the following command: sudo fdisk -l. You’ll see a listing of the partitions. Make note of the desired drive in the format of dev/sda0, dev/sda1, etc.

In Mac OS X, use the following command: diskutil list. You’ll see a listing of the partitions. Make note of the desired drive in the format of /dev/disk0, /dev/disk1, etc.

Now open a command prompt on your OS. If you’re using Windows as the host OS you will also need to go to the root directory of VirtualBox using the following command: cd C:\Program Files\Oracle\VirtualBox

Creating the VirtualBox Hard Drive:

Now you can run the command to create the virtual hard drive file that points to your desired physical drive. For each of the following examples ensure that you input the desired names between the arrows and replace the number or pound sign with your desired drive number.

For Windows:
You often must be administrator to run this command. Make sure your cmd.exe is running as administrator. This also means you must start VirtualBox as administrator to use these drive links.

VBoxManage internalcommands createrawvmdk -filename "C:\Users\\VirtualBox VMs\\.vmdk" -rawdisk \\.\PhysicalDrive#

For Linux:

VBoxManage internalcommands createrawvmdk -filename ".vmdk" -rawdisk /dev/sda

For Mac OS X:

VBoxManage internalcommands createrawvmdk -filename ".vmdk" -rawdisk /dev/disk#

This VMDK will be a very small file that simply points to your physical drive. Now you can attach the VMDK to your VM. To do so, open the VirtualBox GUI, select the desired VM, click Settings, clickStorage, click Add Hard Disk button, select Choose existing drive, and then select the VMDK file you just created.