Use intellij on PC as working environment for laptop - intellij-idea

I've laptop and PC at home. I would like to use my PC which is much stronger that than laptop as working environment for my laptop.
PC works on ubuntu, I've configured and connected ftp server but have no idea how could it work ofc I can compare my local files etc but what if I need to run tests or change git branch. Should I do it via terminal and ssh? Its quite unintuitive. May you know or use any software which enables you to work on laptop but use PC/remote server power for calculations.

Related

Is it possible to have different dev VM environments and access graphics card?

What I want to do on my laptop:
Develop and Run on windows with Visual Studio (CUDA, TensorRT,...)
Develop and Run on Linux (CUDA, TensorRT,...)
Environment to edit videos, photoshop,...
Play games
Environment for general use (web browser, outlook, word,...)
Environment to test applications
Possibly connecting some external GPU to offload the work (cuda,...) from my laptop's graphics card. Since I'm new to this, I haven't researched enough to understand how it can be done. But, this is in my plans.
What I did and reaserched:
As a start, I created VM environements in my host Windows OS using VirtualBox for #1 and #2, but I cannot run inside VM, since it doesn't provide access to graphics card. Even if it did, I still need somehow to switch to a different environment when I want to play games for example.
I probably need hypervisor type 1 if I want to have environment to play games? But, in this case I'll need a second laptop to access it, right?
Is this even possible to do on one laptop (I have strong laptop with enough RAM and SSD)
Graphics cards (GPU) are PCI devices, so they can be passed to VMs with PCI Passthrough. A device is not accessible to the host during passthrough. Hot plug can be used to reattach a graphics card to a different VM or the host without rebooting.
I don't know if a Windows host supports GPU passthrough (maybe you need Windows Server), but Linux host and Windows guest seems to work.
Setting this up is easier if you have a second GPU that remains attached to the host or another computer to control the host during GPU passthrough, for example via SSH.

Can I run one WSL2 virtual machine instance on two system?

I'm new to the WSL2 and wondering if it's possible to run the same WSL2 ubuntu instance on both my desktop and laptop.
Now I am able to use wsl --export and wsl --import method to save and load the system to/from my portable hard drive. But these methods takes a long time.
I notice that wsl --import load a file named ext4.vhdx. Is there a way to load straightly from this file?
Update v2.0:
I was able to get a workaround and it works great.
Thanks to Booting from vhdx here, I was able to load straightly from my vhdx file on my portable hard disk. Windows track down its subsystem with regedit, So we can write our own(p.s: make sure to get BasePath right, it starts with "\\\\?", or you will not be able to access the subsystem' filesystem on your host system.):
Windows Registry Editor Version 5.00
[HKEY_USERS\【your SID here】\SOFTWARE\Microsoft\Windows\CurrentVersion\Lxss\{【UUID here】}]
"State"=dword:00000001
"DistributionName"="distribution name"
"Version"=dword:00000002
"BasePath"="vhdx folder path" 【 e.g. "\\\\?\\E:\\S061\\WSL\\ubuntu-20"】
"Flags"=dword:0000000f
"DefaultUid"=dword:000003e8
I suppose the best way to do this would be to store ext4.vhd on a network storage device accessible to both devices.
I have previosly mentioned how to move ext4.vhd. You can check that out here
Basically you need to export from one machine and import it while making sure the vhd file is configured for wsl to access from the network storage
Since this should *officially* not supported expect some performance hits
Another way would be to run WSL on one computer and ssh/remote desktop to it from another device on the network
I'm of the strong belief that sharing the same ext4 vhd between two VM's simultaneously would be a bad idea. See this and this Unix & Linux StackExchange, including the part about ...
note that sharing LVs/partitions on a single disk between the servers at the same time is NOT very safe. You should only access whole disks from any of the servers at one time.
However, as dopewind's answer mentioned, you can access the WSL instance on one computer (probably the desktop) from another (e.g. the laptop). There are several techniques you can use:
If you have Windows 10 Professional or Enterprise on one of the computers, you can enable Remote Desktop, which allows you to access pretty much everything on one computer from another. RDP ("Remote Desktop Protocol") even works from other devices such as an iPad or Android tablet (or even a phone, although that's a bit of a small screen for a "desktop"). That said, there are better, more idiomatic solutions for WSL ...
You could enable SSH server on the Windows 10 computer with the WSL instance (instructions). This may sound counterintuitive to some people, since Linux itself running in the WSL instance also includes an SSH server (by default). But by SSH'ing from (for example) your laptop into your desktop's Windows 10, you can then launch any WSL instance you have installed (if you choose to install more than one) via wsl -d <distroName>. You also avoid a lot of the network unpleasantness in the next option ...
You could, as mentioned above, enable SSH on the WSL instance (usually something like sudo service ssh start) and then ssh directly into it. However, note that WSL2 instances are NAT'd, so there's a whole lot more hackery that you have to do to get access to the network interface. There's a whole huge thread on the WSL Github about it. Personally, I'd recommend the "Windows SSH Server" option mentioned about to start out with, then you can worry about direct SSH access later if you need it.
Side note: Even though I have SSH enabled on my WSL instances, I still use Windows SSH to proxy to them, to avoid these networking issues.

Accessing Dev Environment from another VM (Virtualbox)

On my OSX machine I have two VM's running:
Development Environment (aka DE) (Linux)
Testing Environment (aka TE) (Win7 IE9)
In my TE, I would like to be able to access a server running on my DE. Pretty straight forward sounding but I'm sort of new.
I'm using Virtualbox as my client on both machines. My dev environment is a vagrant box setup with puppet. I can modify it with virtualbox as well for now. SIMPLEST solution wins. I have tried nested-boxing, it doesn't work :P
I was able to achieve the desired results much more easily than I had anticipated. I had to add the same lines I added to my local machine to my VM.

How to automatically replicate a running VM on ESXi to a computer running locally VMWare Player or VMWare Fusion?

The specific use case I'm dealing in our company is the following:
On a ESXi server, a dedicated VM is running to host a demo environment of a software solution. This demo environment is maintained updated by the development and maintenance team.
At specific points in time, people form sales need to take with them a copy of the latest demo environment (the VM) on their laptop to make customer's demos/presentations.
I wonder if there is a tool to automate this kind of operation silently.
Yes there is.
VMware themself make a product called vCenter Converter which is available here http://www.vmware.com/uk/products/converter/
When using the standalone client choose to convert..
Source : VMware Infrastructure virtual machine
Destination : VMware Workstation or Other VMWare Virtual Machine
You should then be able to open in in Player or Fusion.
*This will require the VMs to be off, if you don't want to turn them off you could clone them first (only available if you aren't using the free ESXi Hypervisor - thus the paid one)
Hope this helps :)

Working on remote server

My OS: Windows 8
Virtualbox guest: Ubuntu 12.10 server
I configured apache server on vbox guest and mapped http, https, ssh port successfully into ubuntu server. It works nice without any problem.
I tried several IDEs like PHPStorm, Netbeans, editors like Sublime, all they do is to copy whole project from server, edit on local machine then sync back.
But it is not what I need. I want to work directly on guest server using ssh/sftp connection. I know that notepad++ has this functionality but I love sublime look and feel.
Is there any way to work on guest server with sublime or any other ide for free? (There is sftp solution but it's paid and works just like other ide's, not directly on guest machine) Any suggestions?
There are two approaches you can choose from, you will probably select the second one:
Use the KDE desktop environment (yes, it also exists for MS Windows). It features so called 'kio-slaves' which allow to use any protocol out there as if you were doing local file system operations. That means when using a KDE editor like 'kate' or even a whole IDE like 'kdevelop4' you can simply say "open file/project" and not only choose a local file, but something like sftp://server/path/file and start working. The network stuff is handled transparently by the environment, it is fully network transparent. This is how systems should be like. I think the GNOME environment had something similar, but it probably has been removed with version 3 of GNOME.
You can 'mount' the guests file system into your MS-Windows file system. not sure about the details how this works in MS-Windows, but I am sure that at least newer versions of MS-Windows have gained such feature. Most likely you are still limited to creating something like a "network harddrive" or something, in other systems (linux, unix, macOS) you can mount whereever in the file system you like. You can use any protocol for this, as long as it is supported by the mounting tools of your local system.
Again two options:
2.a You mount the whole virtual disk. Easy, but might be a problem if that disk is currently used by the guest system.
2.b You export the virtual disk by starting some server in the virtual system: samba is most likely your choice. Then you can mount that smb file export inside your MS-Windows system and start hacking.
Have fun!